warp.quat_twist_angle#

warp.quat_twist_angle(axis: vec3f, q: quatf) → float[source]#
  • Kernel: true
  • Python: true
  • Differentiable: true

Return the unsigned twist magnitude in radians of q around axis.

This discards the sign of the twist, so rotations by +theta and -theta around axis return the same value. Use quat_twist_angle_signed() when the direction of rotation around axis matters.

Parameters:
  • axis – Twist axis, with unit length.

  • q – Rotation quaternion.

Returns:

Unsigned twist angle in radians, in [0, pi] if q[3] >= 0 and in (pi, 2*pi] otherwise, so q and -q can return different angles even though they represent the same rotation. It is unspecified when q is a rotation of 180 degrees about an axis perpendicular to axis.

Return type:

float