headingPitchRollQuaternion

fun headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid: Ellipsoid? = definedExternally, fixedFrameTransform: LocalFrameToFixedFrame? = definedExternally, result: Quaternion? = definedExternally): Quaternion(source)

Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles centered at the provided origin. Heading is the rotation from the local east direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.

// Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
const center = Cartesian3.fromDegrees(0.0, 0.0);
const heading = -Cesium.Math.PI_OVER_TWO;
const pitch = Math.PI_OVER_FOUR;
const roll = 0.0;
const hpr = new HeadingPitchRoll(heading, pitch, roll);
const quaternion = Transforms.headingPitchRollQuaternion(center, hpr);

Return

The modified result parameter or a new Quaternion instance if none was provided.

Parameters

origin

The center point of the local reference frame.

headingPitchRoll

The heading, pitch, and roll.

ellipsoid

The ellipsoid whose fixed frame is used in the transformation. Default value - Ellipsoid.default

fixedFrameTransform

A 4x4 transformation matrix from a reference frame to the provided ellipsoid's fixed reference frame Default value - Transforms.eastNorthUpToFixedFrame

result

The object onto which to store the result.

See also