axis property

Vector3 axis

axis of rotation.

Implementation

Vector3 get axis {
  final double den = 1.0 - (_qStorage[3] * _qStorage[3]);
  if (den < 0.0005) {
    // 0-angle rotation, so axis does not matter
    return new Vector3.zero();
  }

  final double scale = 1.0 / math.sqrt(den);
  return new Vector3(
      _qStorage[0] * scale, _qStorage[1] * scale, _qStorage[2] * scale);
}