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
ENH: New Rotation method approx_equal() #17460
Conversation
1902c92
to
f9142b2
Compare
bd2d6e2
to
ad15a6e
Compare
67ed937
to
5d28ce4
Compare
5d28ce4
to
09645eb
Compare
09645eb
to
2734ebd
Compare
This is good to go. |
84415cd
to
7ec93b1
Compare
8839630
to
bb86868
Compare
bb86868
to
a386d2b
Compare
1eddc6b
to
212ceeb
Compare
188dd59
to
44c06c1
Compare
Sounds good, updated that tolerance to 1e-8. |
I'll bump the milestone since I need to branch soon. If a core developer is confident enough to merge before I branch, they're free to do so and restore the milestone, but this isn't a blocker for branching. |
54ae138
to
048955e
Compare
My opinion is that only
There is another possible implementation of |
8ae3a84
to
5eafdf2
Compare
5eafdf2
to
2fcd64c
Compare
Thank you for the review @nmayorov! I agree that |
2fcd64c
to
6afdd79
Compare
@cython.boundscheck(False) | ||
@cython.wraparound(False) | ||
cdef inline void _compose_quat_single( # calculate p * q into r | ||
cdef inline double _quat_magnitude(const double[:] q): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I would prefer not to have these additional changes in this PR.
If you think it's important to refactor usage of magnitude computations, you can easily do it in other PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, removed them and addressed your other comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to complaint about, except minor docstring formatting.
ec244f2
to
0c93346
Compare
Looks perfect. As there was not much discussion I think I can merge it now. |
Please remember to update the release notes for all the Rotation PRs. :) |
@h-vetinari done, thanks for reminding. |
Reference issue
Closes #17458
What does this implement/fix?
This implements two new methods to scipy.spatial.transform.Rotation objects.
This first is
dist
, which calculates the smallest angular distance between two rotations. For two rotationsp
andq
, the following equivalence holds:The second is
approx_equal
, which calculates the distance between rotations and checks if the angle is under an absolute tolerance ofatol
radians. The defaultatol = 1e-12
is notional and I'm all ears if there's a better number there.Additional information