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

Ellipse functions #13025

Merged
merged 5 commits into from
May 6, 2024
Merged

Ellipse functions #13025

merged 5 commits into from
May 6, 2024

Conversation

lynn-lumen
Copy link
Contributor

Objective

  • Add some useful methods to Ellipse

Solution

  • Added Ellipse::perimeter() and ::focal_length()

@NthTensor NthTensor added C-Feature A new feature, making something new possible A-Math Fundamental domain-agnostic mathematical operations labels Apr 19, 2024
Copy link
Contributor

@mweatherley mweatherley left a comment

Choose a reason for hiding this comment

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

This mostly looks good (I'd just like a little more in the way of sources); it would be nice to have some additional motivation beyond just "filling in the gaps" though (especially for something like focal length, where I don't really know what it's used for).

crates/bevy_math/src/primitives/dim2.rs Show resolved Hide resolved
crates/bevy_math/src/primitives/dim2.rs Show resolved Hide resolved
(a * a - b * b).sqrt()
}

#[inline(always)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to always inline this function, considering it's a pretty long method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of it is just the const array and excluding that, the method really isn't that long. In the end, this is probably a design decision, so if you believe it should be removed, I am happy to do so

crates/bevy_math/src/primitives/dim2.rs Show resolved Hide resolved
crates/bevy_math/src/primitives/dim2.rs Show resolved Hide resolved
Co-Authored-By: IQuick 143 <IQuick143cz@gmail.com>
@pablo-lua pablo-lua added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 6, 2024
@mockersf mockersf added this pull request to the merge queue May 6, 2024
Merged via the queue into bevyengine:main with commit 4f9f987 May 6, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Feature A new feature, making something new possible S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants