Skip to content

Recover small angles from quaternions and vectors - #379

Merged
AlexanderFabisch merged 2 commits into
developfrom
fix/log_quat_near_0_angle
Sep 29, 2026
Merged

AlexanderFabisch merged 2 commits into
developfrom
fix/log_quat_near_0_angle

Conversation

@AlexanderFabisch

Copy link
Copy Markdown
Member

Use arctan2 instead of arccos to extract the rotation angle in

  • axis_angle_from_quaternion
  • axis_angles_from_quaternions
  • axis_angle_from_two_directions
  • angles_between_vectors, 3D case

arccos rounds angles below about 1e-8 to exactly 0 and loses relative precision well above that. Same fix as for axis_angle_from_matrix and axis_angles_from_matrices, see #377.

Use arctan2 instead of arccos to extract the rotation angle in
* axis_angle_from_quaternion
* axis_angles_from_quaternions
* axis_angle_from_two_directions
* angles_between_vectors, 3D case

arccos rounds angles below about 1e-8 to exactly 0 and loses relative
precision well above that. Same fix as for axis_angle_from_matrix and
axis_angles_from_matrices, see #377.
@AlexanderFabisch
AlexanderFabisch merged commit 14186f1 into develop Sep 29, 2026
5 checks passed
@AlexanderFabisch
AlexanderFabisch deleted the fix/log_quat_near_0_angle branch September 29, 2026 14:09
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.

1 participant