EulerAngles constructor

EulerAngles(
  1. double azimuth,
  2. double pitch,
  3. double roll
)

Constructs an EulerAngles.

Implementation

factory EulerAngles(double azimuth, double pitch, double roll) {
  azimuth %= twoPi;
  if (pitch.abs() > halfPi) {
    throw UnsupportedError(
      'The value $pitch is not a valid pitch angle. A valid pitch angle must '
      'be in the range -π/2 (inclusive) to π/2 (inclusive).',
    );
  }
  roll = -(-(roll + pi) % twoPi) + pi;
  return EulerAngles._(pitch, roll, -azimuth);
}