The Y component.
An immutable Cartesian2 instance initialized to (1.0, 1.0).
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).
The number of elements used to pack the object into an array.
Duplicates this Cartesian2 instance.
The modified result parameter or a new Cartesian2 instance if one was not provided.
Compares this Cartesian against the provided Cartesian componentwise and returns
true
if they are equal, false
otherwise.
true
if they are equal, false
otherwise.
Compares this Cartesian against the provided Cartesian componentwise and returns
true
if they pass an absolute or relative tolerance test,
false
otherwise.
true
if they are within the provided epsilon, false
otherwise.
Creates a string representing this Cartesian in the format '(x, y)'.
A string representing the provided Cartesian in the format '(x, y)'.
Computes the absolute value of the provided Cartesian.
The Cartesian whose absolute value is to be computed.
The object onto which to store the result.
The modified result parameter.
Computes the componentwise sum of two Cartesians.
The first Cartesian.
The second Cartesian.
The object onto which to store the result.
The modified result parameter.
Returns the angle, in radians, between the provided Cartesians.
The first Cartesian.
The second Cartesian.
The angle between the Cartesians.
向上取整
Duplicates a Cartesian2 instance.
The Cartesian to duplicate.
The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
Computes the distance between two points.
The first point to compute the distance from.
The second point to compute the distance to.
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 {@link Cartesian2#distance}.
The first point to compute the distance from.
The second point to compute the distance to.
The distance between two points.
Divides the provided Cartesian componentwise by the provided scalar.
The Cartesian to be divided.
The scalar to divide by.
The object onto which to store the result.
The modified result parameter.
Computes the componentwise quotient of two Cartesians.
The first Cartesian.
The second Cartesian.
The object onto which to store the result.
The modified result parameter.
Computes the dot (scalar) product of two Cartesians.
The first Cartesian.
The second Cartesian.
The dot product.
Compares the provided Cartesians componentwise and returns
true
if they are equal, false
otherwise.
true
if left and right are equal, false
otherwise.
Compares the provided Cartesians componentwise and returns
true
if they pass an absolute or relative tolerance test,
false
otherwise.
true
if left and right are within the provided epsilon, false
otherwise.
向下取整
Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the x and y properties of the Cartesian3 and drops z.
The Cartesian3 instance to create a Cartesian2 instance from.
The modified result parameter or a new Cartesian2 instance if one was not provided.
Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the x and y properties of the Cartesian4 and drops z and w.
The Cartesian4 instance to create a Cartesian2 instance from.
The modified result parameter or a new Cartesian2 instance if one was not provided.
Creates a Cartesian2 instance from x and y coordinates.
The x coordinate.
The y coordinate.
The modified result parameter or a new Cartesian2 instance if one was not provided.
Computes project pt on line.
The project pt on line.
Computes the linear interpolation or extrapolation at t using the provided cartesians.
The value corresponding to t at 0.0.
The value corresponding to t at 1.0.
The point along t at which to interpolate.
The object onto which to store the result.
The modified result parameter.
Computes the Cartesian's magnitude (length).
The Cartesian instance whose magnitude is to be computed.
The magnitude.
Computes the provided Cartesian's squared magnitude.
The Cartesian instance whose squared magnitude is to be computed.
The squared magnitude.
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
A cartesian to compare.
A cartesian to compare.
The object into which to store the result.
A cartesian with the maximum components.
Computes the value of the maximum component for the supplied Cartesian.
The cartesian to use.
The value of the maximum component.
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
A cartesian to compare.
A cartesian to compare.
The object into which to store the result.
A cartesian with the minimum components.
Computes the value of the minimum component for the supplied Cartesian.
The cartesian to use.
The value of the minimum component.
Returns the axis that is most orthogonal to the provided Cartesian.
The Cartesian on which to find the most orthogonal axis.
The object onto which to store the result.
The most orthogonal axis.
Multiplies the provided Cartesian componentwise by the provided scalar.
The Cartesian to be scaled.
The scalar to multiply with.
The object onto which to store the result.
The modified result parameter.
Computes the componentwise product of two Cartesians.
The first Cartesian.
The second Cartesian.
The object onto which to store the result.
The modified result parameter.
Negates the provided Cartesian.
The Cartesian to be negated.
The object onto which to store the result.
The modified result parameter.
Computes the normalized form of the supplied Cartesian.
The Cartesian to be normalized.
The object onto which to store the result.
The modified result parameter.
Stores the provided instance into the provided array.
The value to pack.
The array to pack into.
The array that was packed into
Flattens an array of Cartesian2s into and array of components.
The array of cartesians to pack.
The packed array.
四舍五入
Computes the componentwise difference of two Cartesians.
The first Cartesian.
The second Cartesian.
The object onto which to store the result.
The modified result parameter.
Retrieves an instance from a packed array.
The packed array.
The modified result parameter or a new Cartesian2 instance if one was not provided.
Unpacks an array of cartesian components into and array of Cartesian2s.
The array of components to unpack.
The unpacked array.
The X component.