normalize method

Quaternion normalize()

Returns the normalized form of the quaternion.

Implementation

Quaternion normalize() {
  final f = 1 / abs();
  return Quaternion(w * f, x * f, y * f, z * f);
}