Companion

external object Companion : Packable<Cartesian4> (source)

Properties

Link copied to clipboard
external val ONE: Cartesian4

An immutable Cartesian4 instance initialized to (1.0, 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_W: Cartesian4

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

Link copied to clipboard
external val UNIT_X: Cartesian4

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

Link copied to clipboard
external val UNIT_Y: Cartesian4

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

Link copied to clipboard
external val UNIT_Z: Cartesian4

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

Link copied to clipboard
external val ZERO: Cartesian4

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

Functions

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

Computes the absolute value of the provided Cartesian.

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

Computes the componentwise sum of two Cartesians.

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

Constrain a value to lie between two values.

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

Duplicates a Cartesian4 instance.

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

Computes the 4-space distance between two points.

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

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

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

Divides the provided Cartesian componentwise by the provided scalar.

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

Computes the componentwise quotient of two Cartesians.

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

Computes the dot (scalar) product of two Cartesians.

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

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

Link copied to clipboard
external fun equalsEpsilon(left: Cartesian4? = definedExternally, right: Cartesian4? = 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: Cartesian4? = definedExternally): Cartesian4

Creates a Cartesian4 from four consecutive elements in an array.

Link copied to clipboard
external fun fromColor(color: Color, result: Cartesian4? = definedExternally): Cartesian4

Creates a Cartesian4 instance from a Color. red, green, blue, and alpha map to x, y, z, and w, respectively.

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

Creates a Cartesian4 instance from x, y, z and w coordinates.

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

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

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

Computes the Cartesian's magnitude (length).

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

Computes the provided Cartesian's squared magnitude.

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

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

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

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

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

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

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

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

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

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

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

Multiplies the provided Cartesian componentwise by the provided scalar.

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

Computes the componentwise product of two Cartesians.

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

Negates the provided Cartesian.

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

Computes the normalized form of the supplied Cartesian.

Link copied to clipboard
open external override fun pack(value: Cartesian4, 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<Cartesian4>, result: ReadonlyArray<JsDouble>? = definedExternally): ReadonlyArray<JsDouble>

Flattens an array of Cartesian4s into an array of components.

Link copied to clipboard
external fun packFloat(value: Double, result: Cartesian4? = definedExternally): Cartesian4

Packs an arbitrary floating point value to 4 values representable using uint8.

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

Computes the componentwise difference of two Cartesians.

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

Retrieves an instance from a packed array.

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

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