compare_rotation

erwans3.utils.compare_rotation(Rot1: Rotation, Rot2: Rotation) Quantity

Compare two rotations and return the angular difference between them.

Parameters:
  • Rot1 (Rotation) – The first rotation.

  • Rot2 (Rotation) – The second rotation.

Returns:

The maximum angular error between the two rotations in radians.

Return type:

:class:`~astropy.units.Quantity`[rad]

Notes

This function calculates the angular difference between two rotations using quaternion algebra. - This function computes the maximum angular error that can be observed for any vector when comparing two rotations. - The input rotations, Rot1 and Rot2, should be instances of astropy.coordinates.BaseRotation. - The result is returned as an astropy.units.Quantity in radians.

Example

>>> from astropy.coordinates import Rotation
>>> Rot1 = Rotation.from_euler('z', 45, unit='deg')
>>> Rot2 = Rotation.from_euler('x', 30, unit='deg')
>>> error = compare_rotation(Rot1, Rot2)
>>> print(error)
0.3585293793233675 rad