warp.quat_twist_angle_signed#

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

Return the signed twist angle in radians of q around axis.

Unlike quat_twist_angle(), this preserves the sign of the twist, so rotations by +theta and -theta around axis return opposite values. Positive angles follow the right-hand rule about axis.

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

  • q – Rotation quaternion.

Returns:

Signed twist angle in radians, in [-pi, pi] if q[3] >= 0 and in [-2*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