cf_quat_to_axis_angle¶
Category: math
GitHub: cute_math3d.h
Extracts the rotation axis and angle from a unit quaternion.
| Parameters | Description |
|---|---|
q |
The rotation. Should be unit length. |
axis_out |
Written with the unit rotation axis. May be NULL. |
angle_out |
Written with the angle in radians, in [0, 2pi]. May be NULL. |
Remarks¶
The inverse of cf_quat_from_axis_angle. A rotation at (or vanishingly near) the
identity has no meaningful axis, so (1, 0, 0) with angle 0 is returned. Note a
quaternion with negative w reports its angle as greater than pi -- the same
rotation, measured the long way around; negate the quaternion first if you want
the short form.