dfki-ric / pytransform3d

3D transformations for Python.
https://dfki-ric.github.io/pytransform3d/
Other
615 stars 63 forks source link

Fix arccos numerical issue in axis_angle_from_two_directions #266

Closed danielpmorton closed 1 year ago

danielpmorton commented 1 year ago

There was an issue with arccos similar to https://github.com/dfki-ric/pytransform3d/pull/247, so I've clamped the bounds similar to how you've done this in other areas of the code with arccos

All other arccos instances in the _conversions file are clamped, except for this and one other place - in axis_angle_from_quaternion. Should I clamp that one as well?

AlexanderFabisch commented 1 year ago

Hi @danielpmorton ,

thanks for this contribution.

All other arccos instances in the _conversions file are clamped, except for this and one other place - in axis_angle_from_quaternion. Should I clamp that one as well?

Yes, I think it makes sense to clamp it in axis_angle_from_quaternion as well.

danielpmorton commented 1 year ago

Ok, just updated that function, and another instance I found in batch_rotations

AlexanderFabisch commented 1 year ago

Merged to develop, thanks a lot!