Math module

conjugate

procedure · 1 overloadSource

The conjugate (-x, -y, -z, w). For a unit quaternion this is the inverse rotation.

ExampleOpen in playground ↗
q: Quaternion;
set_from_axis_and_angle(*q, xyz(0, 0, 1), 1.0);
p := q * conjugate(q);
assert(abs(p.w - 1) < 0.0001 && abs(p.z) < 0.0001);
conjugate :: (q: Quaternion) -> Quaternion

Negates the vector part. For a unit quaternion this is the inverse rotation.

Parameters

q: Quaternion
the quaternion to conjugate.

Returns

See also