YawPitchRollAngles Class

Three angles that determine the orientation of an object in space. Sometimes referred to as Tait–Bryan angles.

• The matrix construction can be replicated by this logic:
• xyz coordinates have
• x forward
• y to left
• z up
• Note that this is a right handed coordinate system.
• yaw is a rotation of x towards y, i.e. around positive z:
• yawMatrix = Matrix3d.createRotationAroundAxisIndex(2, Angle.createDegrees(yawDegrees));
• pitch is a rotation that raises x towards z, i.e. rotation around negative y:
• pitchMatrix = Matrix3d.createRotationAroundAxisIndex(1, Angle.createDegrees(-pitchDegrees));
• roll is rotation of y towards z, i.e. rotation around positive x:
• rollMatrix = Matrix3d.createRotationAroundAxisIndex(0, Angle.createDegrees(rollDegrees));
• The YPR matrix is the product
• result = yawMatrix.multiplyMatrixMatrix(pitchMatrix.multiplyMatrixMatrix(rollMatrix));
• Note that this is for "column based" matrix, with vectors appearing to the right
• Hence a vector is first rotated by roll, then the pitch, finally yaw.

Methods

Name Description
constructor(yaw: Angle = Angle.zero(), pitch: Angle = Angle.zero(), roll: Angle = Angle.zero()):
clone(): Make a copy of this YawPitchRollAngles.
freeze(): void Freeze this YawPitchRollAngles
isAlmostEqual(other: YawPitchRollAngles): boolean * Compare angles between this and other.
isIdentity(allowPeriodShift: boolean = true): boolean Returns true if this rotation does nothing.
maxAbsDegrees(): number Return the largest angle in degrees.
maxDiffRadians(other: YawPitchRollAngles): number Return the largest difference of angles (in radians) between this and other
setFrom(other: YawPitchRollAngles): void Install all rotations from other into this.
setFromJSON(json?: YawPitchRollProps): void populate yaw, pitch and roll fields using Angle.fromJSON
sumSquaredDegrees(): number Return the sum of squared angles in degrees.
toJSON(): Convert to a JSON object of form { pitch: 20 , roll: 29.999999999999996 , yaw: 10 }.
toMatrix3d(result?: Matrix3d): Expand the angles into a (rigid rotation) matrix.
createDegrees(yawDegrees: number, pitchDegrees: number, rollDegrees: number): Static constructor for YawPitchRollAngles with angles in degrees.
createFromMatrix3d(matrix: Matrix3d, result?: YawPitchRollAngles): YawPitchRollAngles | undefined Static Attempts to create a YawPitchRollAngles object from an Matrix3d
fromJSON(json?: YawPitchRollProps): Static construct a YawPitchRoll object from an object with 3 named angles