Companion

Properties

Link copied to clipboard

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

Link copied to clipboard
open override val packedLength: Int

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Functions

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

Computes the absolute value of the provided Cartesian.

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

Computes the componentwise sum of two Cartesians.

Link copied to clipboard

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

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

Constrain a value to lie between two values.

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

Duplicates a Cartesian2 instance.

Link copied to clipboard
fun cross(left: Cartesian2, right: Cartesian2): Double

Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0

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

Computes the distance between two points.

Link copied to clipboard

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

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

Divides the provided Cartesian componentwise by the provided scalar.

Link copied to clipboard

Computes the componentwise quotient of two Cartesians.

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

Computes the dot (scalar) product of two Cartesians.

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

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

Link copied to clipboard
fun equalsEpsilon(left: Cartesian2? = definedExternally, right: Cartesian2? = 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
fun fromArray(array: ReadonlyArray<Double>, startingIndex: Int? = definedExternally, result: Cartesian2? = definedExternally): Cartesian2

Creates a Cartesian2 from two consecutive elements in an array.

Link copied to clipboard
fun fromCartesian3(cartesian: Cartesian3, result: Cartesian2? = definedExternally): Cartesian2

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

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

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

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

Creates a Cartesian2 instance from x and y coordinates.

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

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

Link copied to clipboard
fun magnitude(cartesian: Cartesian2): Double

Computes the Cartesian's magnitude (length).

Link copied to clipboard

Computes the provided Cartesian's squared magnitude.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

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

Multiplies the provided Cartesian componentwise by the provided scalar.

Link copied to clipboard

Computes the componentwise product of two Cartesians.

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

Negates the provided Cartesian.

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

Computes the normalized form of the supplied Cartesian.

Link copied to clipboard
open override fun pack(value: Cartesian2, array: ReadonlyArray<Double>, startingIndex: Int?): ReadonlyArray<Double>

Stores the provided instance into the provided array.

Link copied to clipboard
fun packArray(array: ReadonlyArray<Cartesian2>, result: ReadonlyArray<Double>? = definedExternally): ReadonlyArray<Double>

Flattens an array of Cartesian2s into an array of components.

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

Computes the componentwise difference of two Cartesians.

Link copied to clipboard
open override fun unpack(array: ReadonlyArray<Double>, startingIndex: Int?, result: Cartesian2?): Cartesian2

Retrieves an instance from a packed array.

Link copied to clipboard
fun unpackArray(array: ReadonlyArray<Double>, result: ReadonlyArray<Cartesian2>? = definedExternally): ReadonlyArray<Cartesian2>

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