warp.quat_twist_angle#

warp.quat_twist_angle(axis: vec3f, q: quatf) float#
  • Kernel

  • Differentiable

Return the unsigned twist magnitude 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.

The result follows the quaternion branch supplied by q. For canonicalized quaternions, the result is in [0, pi]. Noncanonicalized inputs may return values in [0, 2*pi].

Parameters:
  • axis – Twist axis. Expected to be normalized by the caller.

  • q – Input quaternion.

Returns:

Unsigned twist angle in radians.

Return type:

float