Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added utility function solveCubic() #1696

Merged
merged 6 commits into from
Jun 5, 2022

Conversation

st-pasha
Copy link
Contributor

@st-pasha st-pasha commented Jun 4, 2022

Description

The function solves a cubic equation, and can be used for a variety of purposes, such as handling the Bezier curves.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • [-] I have updated/added relevant examples in examples.

Breaking Change

  • [-] Yes, this is a breaking change.
  • No, this is not a breaking change.

Related Issues

Copy link
Contributor

@wolfenrain wolfenrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left a small comment that I kinda forgot in the previous PR😅

///
/// If coefficient [a] is equal to zero, then we solve the equation as a
/// quadratic one (see [solveQuadratic]).
List<double> solveCubic(double a, double b, double c, double d) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be in utils or if we should have a dedicated math section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Math sees itself as a dreamy poet. Science sees it as a supplier of specialized technical equipment. And herein we find one of the greatest paradoxes of human inquiry: These two views, both valid, are hard to reconcile. If math is an equipment supplier, why is its equipment so strangely poetic? And if math is a poet, then why is its poetry so unexpectedly useful?"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, that can be the top level doc for the math section 😄
I agree that we can have a math directory and a barrel file for it, I'm guessing we'll have quite a lot of more things going in there later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can be done on a separate PR though since it will move the other file too

@spydon spydon enabled auto-merge (squash) June 5, 2022 11:35
@spydon spydon merged commit 31784ca into flame-engine:main Jun 5, 2022
st-pasha added a commit to st-pasha/flame that referenced this pull request Jun 5, 2022
The function solves a cubic equation, and can be used for a variety of purposes, such as handling the Bezier curves.
@st-pasha st-pasha deleted the ps.solve-cubic branch June 6, 2022 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants