Companion
Properties
An immutable Cartesian2 instance initialized to (1.0, 1.0).
The number of elements used to pack the object into an array.
An immutable Cartesian2 instance initialized to (1.0, 0.0).
An immutable Cartesian2 instance initialized to (0.0, 1.0).
An immutable Cartesian2 instance initialized to (0.0, 0.0).
Functions
Computes the absolute value of the provided Cartesian.
Computes the componentwise sum of two Cartesians.
Returns the angle, in radians, between the provided Cartesians.
Constrain a value to lie between two values.
Duplicates a Cartesian2 instance.
Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0
Computes the distance between two points.
Computes the squared distance between two points. Comparing squared distances using this function is more efficient than comparing distances using Cartesian2.distance.
Divides the provided Cartesian componentwise by the provided scalar.
Computes the componentwise quotient of two Cartesians.
Computes the dot (scalar) product of two Cartesians.
Compares the provided Cartesians componentwise and returns true
if they are equal, false
otherwise.
Compares the provided Cartesians componentwise and returns true
if they pass an absolute or relative tolerance test, false
otherwise.
Creates a Cartesian2 from two consecutive elements in an array.
Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the x and y properties of the Cartesian3 and drops z.
Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the x and y properties of the Cartesian4 and drops z and w.
Creates a Cartesian2 instance from x and y coordinates.
Computes the linear interpolation or extrapolation at t using the provided cartesians.
Computes the Cartesian's magnitude (length).
Computes the provided Cartesian's squared magnitude.
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
Computes the value of the maximum component for the supplied Cartesian.
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
Computes the value of the minimum component for the supplied Cartesian.
Returns the axis that is most orthogonal to the provided Cartesian.
Multiplies the provided Cartesian componentwise by the provided scalar.
Computes the componentwise product of two Cartesians.
Negates the provided Cartesian.
Computes the normalized form of the supplied Cartesian.
Stores the provided instance into the provided array.
Flattens an array of Cartesian2s into an array of components.
Computes the componentwise difference of two Cartesians.
Retrieves an instance from a packed array.
Unpacks an array of cartesian components into an array of Cartesian2s.