-
-
Notifications
You must be signed in to change notification settings - Fork 492
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
new function to calculate the right-handed angle between two 2d vectors #1404
Open
jonaspleyer
wants to merge
35
commits into
dimforge:main
Choose a base branch
from
jonaspleyer:dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instead of num::Euclid
- also make one vector larger in order to make clear from example that the length of the vectors does not matter
Signed-off-by: Markus Mayer <[email protected]>
The existing implementation compares each component to zero with an epsilon; effectively `glm::all(glm::is_comp_null(v, epsilon))`. This probably isn't the desired semantics when calling `glm::is_null`; rather, we want to determine if the magnitude of the vector is within `epsilon` units of zero. It's the question of circle versus square. This behavior matches that of OpenGL Mathematics.
* Add macro for concatenating matrices * Replace DimUnify with DimEq::representative * Add some simple cat macro output generation tests * Fix formatting in cat macro code * Add random prefix to cat macro output * Add simple quote_spanned for cat macro * Use `generic_view_mut` in cat macro * Fix clippy lints in cat macro * Clean up documentation for cat macro * Remove identity literal from cat macro * Allow references in input to cat macro * Rename cat macro to stack * Add more stack macro tests * Add comment to explain reason for prefix in stack! macro * Refactor matrix!, stack! macros into separate modules * Take all blocks by reference in stack! macro * Make empty stack![] invocation well-defined * Fix stack! macro incorrect reference to data * More extensive tests for stack! macro * Move nalgebra-macros tests to nalgebra tests By testing matrix!, stack! macros etc. in nalgebra, we ensure that these macros are used in the same way that users will be using them. * Fix stack! code generation tests * Add back nalgebra as dev-dependency of nalgebra-macros * Fix accidental wrong matrix! macro references in docs * Rewrite stack! documentation for clarity * Formatting * Skip formatting of macro, rustfmt messes it up * Rewrite stack! impl for improved clarity, Span behavior This improves error messages upon dimension mismatch, among other things. I've also tried to make the implementation easier to understand, adding some comments to help the reader understand the individual steps. * Use SameNumberOfRows/Columns instead of DimEq in stack! macro This gives more accurate compiler errors if matrix dimensions are mismatched. * Check that stack! panics at runtime for basic dimension mismatch * Add suggested edge cases from initial PR to tests * stack! impl: use fixed prefix everywhere This ensures that the expected generated code in tests is the actual generated code when used in the wild. * nalgebra-macros: Remove clippy pedantic, fix clippy complaints pedantic seems to be mostly intent on wasting the programmer's time * Add stack! sanity tests for built-ins and Complex * Fix formatting in test * Improve readability of format_ident! calls in stack! impl * fix trybuild tests * chore: run tests with a specific rust version * More trybuild fixes --------- Co-authored-by: Birk Tjelmeland <[email protected]> Co-authored-by: Sébastien Crozet <[email protected]>
…neric_resize() (dimforge#1416) * Add Storage::forget * Adjust implementations of Reallocator to use Storage::forget * Fix formatting * Rename forget to forget_elements and add safety comments * Update comments in Reallocator implementations --------- Co-authored-by: Nick Mertin <[email protected]>
* Stop using `xargo` and just use a regular `cargo` build. * Use `stable` rather than `nightly` as that works with `cargo`. * Update from `actions-rs/toolchain` for this job to `dtolnay/rust-toolchain` as the `actions-rs` action is unmaintained. * Switch from `x86_64-unknown-linux-gnu` to `x86_64-unknown-none` as that is a 64 bit target that has no `std` lib. * Keep the 32 bit ARM target testing to keep that coverage. * Fix the `rand-no-std` test to pass that feature to the build.
* Support conversion for glam 0.29 * Update CHANGELOG.md --------- Co-authored-by: Sébastien Crozet <[email protected]>
instead of num::Euclid
- also make one vector larger in order to make clear from example that the length of the vectors does not matter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds functionality to calculate the right-handed angle of two 2d vectors. This is different to the already existing
angle
function.I was unsure how to correctly make use of all the traits such as
SimdRealField
andSimdComplexField
. Please let me know if I should re-structure this PR in any way.Please let me know what you think!