new Cartesian4
A 4D Cartesian point.
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
x |
Number |
<optional> |
0.0 | The X component. |
y |
Number |
<optional> |
0.0 | The Y component. |
z |
Number |
<optional> |
0.0 | The Z component. |
w |
Number |
<optional> |
0.0 | The W component. |
See:
Members
-
w :Number
-
The W component.
-
x :Number
-
The X component.
-
y :Number
-
The Y component.
-
z :Number
-
The Z component.
-
<static> UNIT_W
-
An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
-
<static> UNIT_X
-
An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
-
<static> UNIT_Y
-
An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
-
<static> UNIT_Z
-
An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
-
<static> ZERO
-
An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
Methods
-
abs
-
Computes the absolute value of this Cartesian.
Parameters:
Name Type Argument Description resultCartesian4 <optional>
The object onto which to store the result. Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
add
-
Computes the componentwise sum of this Cartesian and the provided Cartesian.
Parameters:
Name Type Argument Description rightCartesian4 The right hand side Cartesian. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : right is required.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
clone
-
Duplicates this Cartesian4 instance.
Parameters:
Name Type Argument Description resultCartesian4 <optional>
The object onto which to store the result. Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
divideByScalar
-
Divides this Cartesian componentwise by the provided scalar.
Parameters:
Name Type Argument Description scalarNumber The scalar to divide by. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : scalar is required and must be a number.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
dot
-
Computes the dot (scalar) product of this Cartesian and a supplied cartesian.
Parameters:
Name Type Description rightCartesian4 The right hand side Cartesian. Throws:
DeveloperError : right is required.Returns:
Number The dot product. -
equals
-
Compares this Cartesian against the provided Cartesian componentwise and returns
trueif they are equal,falseotherwise.Parameters:
Name Type Argument Description rightCartesian4 <optional>
The right hand side Cartesian. Returns:
Booleantrueif they are equal,falseotherwise. -
equalsEpsilon
-
Compares this Cartesian against the provided Cartesian componentwise and returns
trueif they are within the provided epsilon,falseotherwise.Parameters:
Name Type Argument Description rightCartesian4 <optional>
The right hand side Cartesian. epsilonNumber The epsilon to use for equality testing. Throws:
DeveloperError : epsilon is required and must be a number.Returns:
Booleantrueif they are within the provided epsilon,falseotherwise. -
getMaximumComponent
-
Computes the value of the maximum component for this Cartesian.
Returns:
Number The value of the maximum component. -
getMinimumComponent
-
Computes the value of the minimum component for this Cartesian.
Returns:
Number The value of the minimum component. -
lerp
-
Computes the linear interpolation or extrapolation at t using this Cartesian and the provided cartesian. This cartesian is assumed to be t at 0.0.
Parameters:
Name Type Argument Description endThe value corresponding to t at 1.0. tThe point along t at which to interpolate. resultCartesian4 <optional>
The object onto which to store the result. Throws:
-
DeveloperError : end is required.
-
DeveloperError : t is required and must be a number.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
-
magnitude
-
Computes this Cartesian's magnitude (length).
Returns:
Number The magnitude. -
magnitudeSquared
-
Computes this Cartesian's squared magnitude.
Returns:
Number The squared magnitude. -
mostOrthogonalAxis
-
Returns the axis that is most orthogonal to the this Cartesian.
Parameters:
Name Type Argument Description resultCartesian4 <optional>
The object onto which to store the result. Returns:
Cartesian4 The most orthogonal axis. -
multiplyByScalar
-
Multiplies this Cartesian componentwise by the provided scalar.
Parameters:
Name Type Argument Description scalarNumber The scalar to multiply with. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : scalar is required and must be a number.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
multiplyComponents
-
Computes the componentwise product of this Cartesian and the provided Cartesian.
Parameters:
Name Type Argument Description rightCartesian4 The right hand side Cartesian. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : right is required.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
negate
-
Negates this Cartesian.
Parameters:
Name Type Argument Description resultCartesian4 <optional>
The object onto which to store the result. Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
normalize
-
Computes the normalized form of this Cartesian.
Parameters:
Name Type Argument Description resultCartesian4 <optional>
The object onto which to store the result. Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
subtract
-
Computes the componentwise difference of this Cartesian and the provided Cartesian.
Parameters:
Name Type Argument Description rightCartesian4 The right hand side Cartesian. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : right is required.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
toString
-
Creates a string representing this Cartesian in the format '(x, y)'.
Returns:
String A string representing the provided Cartesian in the format '(x, y)'. -
<static> abs
-
Computes the absolute value of the provided Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian whose absolute value is to be computed. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : cartesian is required.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
<static> add
-
Computes the componentwise sum of two Cartesians.
Parameters:
Name Type Argument Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. resultCartesian4 <optional>
The object onto which to store the result. Throws:
-
DeveloperError : left is required.
-
DeveloperError : right is required.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
-
<static> clone
-
Duplicates a Cartesian4 instance.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian to duplicate. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : cartesian is required.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
<static> divideByScalar
-
Divides the provided Cartesian componentwise by the provided scalar.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian to be divided. scalarNumber The scalar to divide by. resultCartesian4 <optional>
The object onto which to store the result. Throws:
-
DeveloperError : cartesian is required.
-
DeveloperError : scalar is required and must be a number.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
-
<static> dot
-
Computes the dot (scalar) product of two Cartesians.
Parameters:
Name Type Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. Throws:
-
DeveloperError : left is required.
-
DeveloperError : right is required.
Returns:
Number The dot product. -
-
<static> equals
-
Compares the provided Cartesians componentwise and returns
trueif they are equal,falseotherwise.Parameters:
Name Type Argument Description leftCartesian4 <optional>
The first Cartesian. rightCartesian4 <optional>
The second Cartesian. Returns:
Booleantrueif left and right are equal,falseotherwise. -
<static> equalsEpsilon
-
Compares the provided Cartesians componentwise and returns
trueif they are within the provided epsilon,falseotherwise.Parameters:
Name Type Argument Description leftCartesian4 <optional>
The first Cartesian. rightCartesian4 <optional>
The second Cartesian. epsilonNumber The epsilon to use for equality testing. Throws:
DeveloperError : epsilon is required and must be a number.Returns:
Booleantrueif left and right are within the provided epsilon,falseotherwise. -
<static> getMaximumComponent
-
Computes the value of the maximum component for the supplied Cartesian.
Parameters:
Name Type Description TheCartesian4 cartesian to use. Throws:
DeveloperError : cartesian is required.Returns:
Number The value of the maximum component. -
<static> getMinimumComponent
-
Computes the value of the minimum component for the supplied Cartesian.
Parameters:
Name Type Description TheCartesian4 cartesian to use. Throws:
DeveloperError : cartesian is required.Returns:
Number The value of the minimum component. -
<static> lerp
-
Computes the linear interpolation or extrapolation at t using the provided cartesians.
Parameters:
Name Type Argument Description startThe value corresponding to t at 0.0. endThe value corresponding to t at 1.0. tThe point along t at which to interpolate. resultCartesian4 <optional>
The object onto which to store the result. Throws:
-
DeveloperError : start is required.
-
DeveloperError : end is required.
-
DeveloperError : t is required and must be a number.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
-
<static> magnitude
-
Computes the Cartesian's magnitude (length).
Parameters:
Name Type Description cartesianCartesian4 The Cartesian instance whose magnitude is to be computed. Throws:
DeveloperError : cartesian is required.Returns:
Number The magnitude. -
<static> magnitudeSquared
-
Computes the provided Cartesian's squared magnitude.
Parameters:
Name Type Description cartesianCartesian4 The Cartesian instance whose squared magnitude is to be computed. Throws:
DeveloperError : cartesian is required.Returns:
Number The squared magnitude. -
<static> mostOrthogonalAxis
-
Returns the axis that is most orthogonal to the provided Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian on which to find the most orthogonal axis. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : cartesian is required.Returns:
Cartesian4 The most orthogonal axis. -
<static> multiplyByScalar
-
Multiplies the provided Cartesian componentwise by the provided scalar.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian to be scaled. scalarNumber The scalar to multiply with. resultCartesian4 <optional>
The object onto which to store the result. Throws:
-
DeveloperError : cartesian is required.
-
DeveloperError : scalar is required and must be a number.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
-
<static> multiplyComponents
-
Computes the componentwise product of two Cartesians.
Parameters:
Name Type Argument Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. resultCartesian4 <optional>
The object onto which to store the result. Throws:
-
DeveloperError : left is required.
-
DeveloperError : right is required.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
-
<static> negate
-
Negates the provided Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian to be negated. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : cartesian is required.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
<static> normalize
-
Computes the normalized form of the supplied Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian to be normalized. resultCartesian4 <optional>
The object onto which to store the result. Throws:
DeveloperError : cartesian is required.Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
<static> subtract
-
Computes the componentwise difference of two Cartesians.
Parameters:
Name Type Argument Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. resultCartesian4 <optional>
The object onto which to store the result. Throws:
-
DeveloperError : left is required.
-
DeveloperError : right is required.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided. -
