Companion

external object Companion : Packable<Cartesian3> (source)

Properties

Link copied to clipboard
external val ONE: Cartesian3

An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).

Link copied to clipboard
open external override val packedLength: Int

The number of elements used to pack the object into an array.

Link copied to clipboard
external val UNIT_X: Cartesian3

An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).

Link copied to clipboard
external val UNIT_Y: Cartesian3

An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).

Link copied to clipboard
external val UNIT_Z: Cartesian3

An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).

Link copied to clipboard
external val ZERO: Cartesian3

An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).

Functions

Link copied to clipboard
external fun abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3

Computes the absolute value of the provided Cartesian.

Link copied to clipboard
external fun add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3

Computes the componentwise sum of two Cartesians.

Link copied to clipboard
external fun angleBetween(left: Cartesian3, right: Cartesian3): Double

Returns the angle, in radians, between the provided Cartesians.

Link copied to clipboard
external fun clamp(value: Cartesian3, min: Cartesian3, max: Cartesian3, result: Cartesian3): Cartesian3

Constrain a value to lie between two values.

Link copied to clipboard
external fun clone(cartesian: Cartesian3, result: Cartesian3? = definedExternally): Cartesian3

Duplicates a Cartesian3 instance.

Link copied to clipboard
external fun cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3

Computes the cross (outer) product of two Cartesians.

Link copied to clipboard
external fun distance(left: Cartesian3, right: Cartesian3): Double

Computes the distance between two points.

Link copied to clipboard
external fun distanceSquared(left: Cartesian3, right: Cartesian3): Double

Computes the squared distance between two points. Comparing squared distances using this function is more efficient than comparing distances using Cartesian3.distance.

Link copied to clipboard
external fun divideByScalar(cartesian: Cartesian3, scalar: Double, result: Cartesian3): Cartesian3

Divides the provided Cartesian componentwise by the provided scalar.

Link copied to clipboard
external fun divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3

Computes the componentwise quotient of two Cartesians.

Link copied to clipboard
external fun dot(left: Cartesian3, right: Cartesian3): Double

Computes the dot (scalar) product of two Cartesians.

Link copied to clipboard
external fun equals(left: Cartesian3? = definedExternally, right: Cartesian3? = definedExternally): Boolean

Compares the provided Cartesians componentwise and returns true if they are equal, false otherwise.

Link copied to clipboard
external fun equalsEpsilon(left: Cartesian3? = definedExternally, right: Cartesian3? = definedExternally, relativeEpsilon: Double? = definedExternally, absoluteEpsilon: Double? = definedExternally): Boolean

Compares the provided Cartesians componentwise and returns true if they pass an absolute or relative tolerance test, false otherwise.

Link copied to clipboard
external fun fromArray(array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3

Creates a Cartesian3 from three consecutive elements in an array.

Link copied to clipboard
external fun fromCartesian4(cartesian: Cartesian4, result: Cartesian3? = definedExternally): Cartesian3

Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the x, y, and z properties of the Cartesian4 and drops w.

Link copied to clipboard
external fun fromDegrees(longitude: Double, latitude: Double, height: Double? = definedExternally, ellipsoid: Ellipsoid? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3

Returns a Cartesian3 position from longitude and latitude values given in degrees.

Link copied to clipboard
external fun fromDegreesArray(coordinates: ReadonlyArray<JsDouble>, ellipsoid: Ellipsoid? = definedExternally, result: ReadonlyArray<Cartesian3>? = definedExternally): ReadonlyArray<Cartesian3>

Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.

Link copied to clipboard
external fun fromDegreesArrayHeights(coordinates: ReadonlyArray<JsDouble>, ellipsoid: Ellipsoid? = definedExternally, result: ReadonlyArray<Cartesian3>? = definedExternally): ReadonlyArray<Cartesian3>

Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.

Link copied to clipboard
external fun fromElements(x: Double, y: Double, z: Double, result: Cartesian3? = definedExternally): Cartesian3

Creates a Cartesian3 instance from x, y and z coordinates.

Link copied to clipboard
external fun fromRadians(longitude: Double, latitude: Double, height: Double? = definedExternally, ellipsoid: Ellipsoid? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3

Returns a Cartesian3 position from longitude and latitude values given in radians.

Link copied to clipboard
external fun fromRadiansArray(coordinates: ReadonlyArray<JsDouble>, ellipsoid: Ellipsoid? = definedExternally, result: ReadonlyArray<Cartesian3>? = definedExternally): ReadonlyArray<Cartesian3>

Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.

Link copied to clipboard
external fun fromRadiansArrayHeights(coordinates: ReadonlyArray<JsDouble>, ellipsoid: Ellipsoid? = definedExternally, result: ReadonlyArray<Cartesian3>? = definedExternally): ReadonlyArray<Cartesian3>

Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.

Link copied to clipboard
external fun fromSpherical(spherical: Spherical, result: Cartesian3? = definedExternally): Cartesian3

Converts the provided Spherical into Cartesian3 coordinates.

Link copied to clipboard
external fun lerp(start: Cartesian3, end: Cartesian3, t: Double, result: Cartesian3): Cartesian3

Computes the linear interpolation or extrapolation at t using the provided cartesians.

Link copied to clipboard
external fun magnitude(cartesian: Cartesian3): Double

Computes the Cartesian's magnitude (length).

Link copied to clipboard
external fun magnitudeSquared(cartesian: Cartesian3): Double

Computes the provided Cartesian's squared magnitude.

Link copied to clipboard
external fun maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3

Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.

Link copied to clipboard
external fun maximumComponent(cartesian: Cartesian3): Double

Computes the value of the maximum component for the supplied Cartesian.

Link copied to clipboard
external fun midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3

Computes the midpoint between the right and left Cartesian.

Link copied to clipboard
external fun minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3

Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.

Link copied to clipboard
external fun minimumComponent(cartesian: Cartesian3): Double

Computes the value of the minimum component for the supplied Cartesian.

Link copied to clipboard
external fun mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3

Returns the axis that is most orthogonal to the provided Cartesian.

Link copied to clipboard
external fun multiplyByScalar(cartesian: Cartesian3, scalar: Double, result: Cartesian3): Cartesian3

Multiplies the provided Cartesian componentwise by the provided scalar.

Link copied to clipboard
external fun multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3

Computes the componentwise product of two Cartesians.

Link copied to clipboard
external fun negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3

Negates the provided Cartesian.

Link copied to clipboard
external fun normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3

Computes the normalized form of the supplied Cartesian.

Link copied to clipboard
open external override fun pack(value: Cartesian3, array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally): ReadonlyArray<JsDouble>

Stores the provided instance into the provided array.

Link copied to clipboard
external fun packArray(array: ReadonlyArray<Cartesian3>, result: ReadonlyArray<JsDouble>? = definedExternally): ReadonlyArray<JsDouble>

Flattens an array of Cartesian3s into an array of components.

Link copied to clipboard

Projects vector a onto vector b

Link copied to clipboard
external fun subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3

Computes the componentwise difference of two Cartesians.

Link copied to clipboard
open external override fun unpack(array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3

Retrieves an instance from a packed array.

Link copied to clipboard
external fun unpackArray(array: ReadonlyArray<JsDouble>, result: ReadonlyArray<Cartesian3>? = definedExternally): ReadonlyArray<Cartesian3>

Unpacks an array of cartesian components into an array of Cartesian3s.