Transforms

external object Transforms(source)

Contains functions for transforming positions to various reference frames.

See also

Functions

Link copied to clipboard
fun computeFixedToIcrfMatrix(date: JulianDate, result: Matrix3? = definedExternally): Matrix3?

Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF) to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes at a given time. This function may return undefined if the data necessary to do the transformation is not yet loaded.

Link copied to clipboard
fun computeIcrfToCentralBodyFixedMatrix(date: JulianDate, result: Matrix3? = definedExternally): Matrix3?

The default function to compute a rotation matrix to transform a point or vector from the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes to the central body, typically Earth, fixed frame axis at a given time for use in lighting and transformation from inertial reference frames. This function may return undefined if the data necessary to do the transformation is not yet loaded.

Link copied to clipboard
fun computeIcrfToFixedMatrix(date: JulianDate, result: Matrix3? = definedExternally): Matrix3?

Computes a rotation matrix to transform a point or vector from the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF) at a given time. This function may return undefined if the data necessary to do the transformation is not yet loaded.

Link copied to clipboard
fun computeIcrfToMoonFixedMatrix(date: JulianDate, result: Matrix3? = definedExternally): Matrix3

Computes a rotation matrix to transform a point or vector from the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes to the Moon-Fixed frame axes at a given time.

Link copied to clipboard
fun computeMoonFixedToIcrfMatrix(date: JulianDate, result: Matrix3? = definedExternally): Matrix3

Computes a rotation matrix to transform a point or vector from the Moon-Fixed frame axes to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes at a given time.

Link copied to clipboard
fun computeTemeToPseudoFixedMatrix(date: JulianDate, result: Matrix3? = definedExternally): Matrix3

Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.

Link copied to clipboard
fun eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid: Ellipsoid? = definedExternally, result: Matrix4? = definedExternally): Matrix4

Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes centered at the provided origin to the provided ellipsoid's fixed reference frame. The local axes are defined as:

Link copied to clipboard
fun fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid: Ellipsoid? = definedExternally, fixedFrameTransform: LocalFrameToFixedFrame? = definedExternally, result: HeadingPitchRoll? = definedExternally): HeadingPitchRoll

Computes heading-pitch-roll angles from a transform in a particular reference frame. 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.

Link copied to clipboard
fun headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid: Ellipsoid? = definedExternally, fixedFrameTransform: LocalFrameToFixedFrame? = definedExternally, result: Quaternion? = definedExternally): Quaternion

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.

Link copied to clipboard
fun headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid: Ellipsoid? = definedExternally, fixedFrameTransform: LocalFrameToFixedFrame? = definedExternally, result: Matrix4? = definedExternally): Matrix4

Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles centered at the provided origin to the provided ellipsoid's fixed reference frame. 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.

Link copied to clipboard

Generates a function that computes a 4x4 transformation matrix from a reference frame centered at the provided origin to the provided ellipsoid's fixed reference frame.

Link copied to clipboard
fun northEastDownToFixedFrame(origin: Cartesian3, ellipsoid: Ellipsoid? = definedExternally, result: Matrix4? = definedExternally): Matrix4

Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes centered at the provided origin to the provided ellipsoid's fixed reference frame. The local axes are defined as:

Link copied to clipboard
fun northUpEastToFixedFrame(origin: Cartesian3, ellipsoid: Ellipsoid? = definedExternally, result: Matrix4? = definedExternally): Matrix4

Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes centered at the provided origin to the provided ellipsoid's fixed reference frame. The local axes are defined as:

Link copied to clipboard
fun northWestUpToFixedFrame(origin: Cartesian3, ellipsoid: Ellipsoid? = definedExternally, result: Matrix4? = definedExternally): Matrix4

Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes centered at the provided origin to the provided ellipsoid's fixed reference frame. The local axes are defined as:

Link copied to clipboard
fun pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result: Cartesian2? = definedExternally): Cartesian2

Transform a point from model coordinates to window coordinates.

Link copied to clipboard
suspend fun preloadIcrfFixed(timeInterval: TimeInterval)

Preloads the data necessary to transform between the ICRF and Fixed axes, in either direction, over a given interval. This function returns a promise that, when resolved, indicates that the preload has completed.

Link copied to clipboard
Link copied to clipboard
fun rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid: Ellipsoid? = definedExternally, result: Matrix3? = definedExternally): Matrix3

Transform a position and velocity to a rotation matrix.