YawPitchRollAngles Class

Three angles that determine the orientation of an object in space, sometimes referred to as [Tait–Bryan angles] (https://en.wikipedia.org/wiki/Euler_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 (counterclockwise):
    • yawMatrix = Matrix3d.createRotationAroundAxisIndex(2, Angle.createDegrees(yawDegrees));
  • pitch is a rotation that raises x towards z, i.e. rotation around negative y (clockwise):
    • pitchMatrix = Matrix3d.createRotationAroundAxisIndex(1, Angle.createDegrees(-pitchDegrees));
  • roll is rotation of y towards z, i.e. rotation around positive x (counterclockwise):
    • 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 multiplying on the right of the matrix. Hence a vector is first rotated by roll, then the pitch, finally yaw. So multiplication order in the sense of AxisOrder is RPY (i.e., XYZ), in contrast to the familiar name YPR.

Methods

Name Description
constructor(yaw: Angle = ..., pitch: Angle = ..., roll: Angle = ...): YawPitchRollAngles Constructor  
clone(): YawPitchRollAngles Make a copy of this YawPitchRollAngles  
freeze(): Readonly<YawPitchRollAngles> 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.  
maxAbsRadians(): number Return the largest angle in radians  
maxDiffDegrees(other: YawPitchRollAngles): number Return the largest difference of angles (in degrees) between this and other  
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.  
sumSquaredRadians(): number Return the sum of the angles in squared radians  
toJSON(): YawPitchRollProps Convert to a JSON object of form { pitch: 20 , roll: 30 , yaw: 10 }.  
toMatrix3d(result?: Matrix3d): Matrix3d Expand the angles into a (rigid rotation) matrix.  
createDegrees(yawDegrees: number, pitchDegrees: number, rollDegrees: number): YawPitchRollAngles Static Constructor for YawPitchRollAngles with angles in degrees.  
createFromMatrix3d(matrix: Matrix3d, result?: YawPitchRollAngles): undefined | YawPitchRollAngles Static Attempts to create a YawPitchRollAngles object from a Matrix3d.  
createRadians(yawRadians: number, pitchRadians: number, rollRadians: number): YawPitchRollAngles Static Constructor for YawPitchRollAngles with angles in radians.  
fromJSON(json?: YawPitchRollProps): YawPitchRollAngles Static Construct a YawPitchRoll object from an object with 3 named angles  
tryFromTransform(transform: Transform): { angles: undefined | YawPitchRollAngles, origin: Point3d } Static Return an object from a Transform as an origin and YawPitchRollAngles.  

Properties

Name Type Description
pitch Angle The pitch angle: clockwise rotation angle around y  
roll Angle The roll angle: counterclockwise rotation angle around x  
yaw Angle The yaw angle: counterclockwise rotation angle around z  

Defined in

Last Updated: 15 March, 2024