new Cartesian4(x, y, z, w)
A 4D Cartesian point.
| Name | Type | Default | Description |
|---|---|---|---|
x |
Number |
0.0
|
optional The X component. |
y |
Number |
0.0
|
optional The Y component. |
z |
Number |
0.0
|
optional The Z component. |
w |
Number |
0.0
|
optional The W component. |
See:
Source:
Core/Cartesian4.js, line 28
Members
-
w :Number
-
The W component.
-
Default Value:
0.0Source: Core/Cartesian4.js, line 55 -
x :Number
-
The X component.
-
Default Value:
0.0Source: Core/Cartesian4.js, line 34 -
y :Number
-
The Y component.
-
Default Value:
0.0Source: Core/Cartesian4.js, line 41 -
z :Number
-
The Z component.
-
Default Value:
0.0Source: Core/Cartesian4.js, line 48 -
staticCartesian4.fromArray
-
Creates a Cartesian4 from four consecutive elements in an array.
Example:
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) var v = [1.0, 2.0, 3.0, 4.0]; var p = Cesium.Cartesian4.fromArray(v); // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0]; var p2 = Cesium.Cartesian4.fromArray(v2, 2);Source: Core/Cartesian4.js, line 214 -
staticCartesian4.packedLength :Number
-
The number of elements used to pack the object into an array.Source: Core/Cartesian4.js, line 137
-
staticCartesian4.UNIT_W
-
An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).Source: Core/Cartesian4.js, line 757
-
staticCartesian4.UNIT_X
-
An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).Source: Core/Cartesian4.js, line 739
-
staticCartesian4.UNIT_Y
-
An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).Source: Core/Cartesian4.js, line 745
-
staticCartesian4.UNIT_Z
-
An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).Source: Core/Cartesian4.js, line 751
-
staticCartesian4.ZERO
-
An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).Source: Core/Cartesian4.js, line 733
Methods
-
clone(result) → Cartesian4
-
Duplicates this Cartesian4 instance.
Name Type Description resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 766 -
equals(right) → Boolean
-
Compares this Cartesian against the provided Cartesian componentwise and returns
trueif they are equal,falseotherwise.Name Type Description rightCartesian4 optional The right hand side Cartesian. Returns:
trueif they are equal,falseotherwise.Source: Core/Cartesian4.js, line 778 -
equalsEpsilon(right, epsilon) → Boolean
-
Compares this Cartesian against the provided Cartesian componentwise and returns
trueif they are within the provided epsilon,falseotherwise.Name Type Description rightCartesian4 optional The right hand side Cartesian. epsilonNumber The epsilon to use for equality testing. Returns:
trueif they are within the provided epsilon,falseotherwise.Source: Core/Cartesian4.js, line 792 -
toString() → String
-
Creates a string representing this Cartesian in the format '(x, y)'.
Returns:
A string representing the provided Cartesian in the format '(x, y)'.Source: Core/Cartesian4.js, line 802 -
staticCartesian4.abs(cartesian, result) → Cartesian4
-
Computes the absolute value of the provided Cartesian.
Name Type Description cartesianCartesian4 The Cartesian whose absolute value is to be computed. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 591 -
staticCartesian4.add(left, right, result) → Cartesian4
-
Computes the componentwise sum of two Cartesians.
Name Type Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 451 -
staticCartesian4.clone(cartesian, result) → Cartesian4
-
Duplicates a Cartesian4 instance.
Name Type Description cartesianCartesian4 The Cartesian to duplicate. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)Source: Core/Cartesian4.js, line 116 -
staticCartesian4.distance(left, right) → Number
-
Computes the 4-space distance between two points
Name Type Description leftCartesian4 The first point to compute the distance from. rightCartesian4 The second point to compute the distance to. Returns:
The distance between two points.Example:
// Returns 1.0 var d = Cesium.Cartesian4.distance(new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0), new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));Source: Core/Cartesian4.js, line 355 -
staticCartesian4.divideByScalar(cartesian, scalar, result) → Cartesian4
-
Divides the provided Cartesian componentwise by the provided scalar.
Name Type Description cartesianCartesian4 The Cartesian to be divided. scalarNumber The scalar to divide by. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 538 -
staticCartesian4.dot(left, right) → Number
-
Computes the dot (scalar) product of two Cartesians.
Name Type Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. Returns:
The dot product.Source: Core/Cartesian4.js, line 400 -
staticCartesian4.equals(left, right) → Boolean
-
Compares the provided Cartesians componentwise and returns
trueif they are equal,falseotherwise.Name Type Description leftCartesian4 optional The first Cartesian. rightCartesian4 optional The second Cartesian. Returns:
trueif left and right are equal,falseotherwise.Source: Core/Cartesian4.js, line 692 -
staticCartesian4.equalsEpsilon(left, right, epsilon) → Boolean
-
Compares the provided Cartesians componentwise and returns
trueif they are within the provided epsilon,falseotherwise.Name Type Description leftCartesian4 optional The first Cartesian. rightCartesian4 optional The second Cartesian. epsilonNumber The epsilon to use for equality testing. Returns:
trueif left and right are within the provided epsilon,falseotherwise.Source: Core/Cartesian4.js, line 713 -
staticCartesian4.fromColor(color, result) → Cartesian4
-
Creates a Cartesian4 instance from a
Color.red,green,blue, andalphamap tox,y,z, andw, respectively.Name Type Description colorColor The source color. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 90 -
staticCartesian4.fromElements(x, y, z, w, result) → Cartesian4
-
Creates a Cartesian4 instance from x, y, z and w coordinates.
Name Type Description xNumber The x coordinate. yNumber The y coordinate. zNumber The z coordinate. wNumber The w coordinate. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 69 -
staticCartesian4.getMaximumByComponent(first, second, result) → Cartesian4
-
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
Name Type Description firstCartesian4 A cartesian to compare. secondCartesian4 A cartesian to compare. resultCartesian4 optional The object into which to store the result. Returns:
A cartesian with the maximum components.Source: Core/Cartesian4.js, line 290 -
staticCartesian4.getMaximumComponent(cartesian) → Number
-
Computes the value of the maximum component for the supplied Cartesian.
Name Type Description cartesianCartesian4 The cartesian to use. Returns:
The value of the maximum component.Source: Core/Cartesian4.js, line 223 -
staticCartesian4.getMinimumByComponent(first, second, result) → Cartesian4
-
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
Name Type Description firstCartesian4 A cartesian to compare. secondCartesian4 A cartesian to compare. resultCartesian4 optional The object into which to store the result. Returns:
A cartesian with the minimum components.Source: Core/Cartesian4.js, line 259 -
staticCartesian4.getMinimumComponent(cartesian) → Number
-
Computes the value of the minimum component for the supplied Cartesian.
Name Type Description cartesianCartesian4 The cartesian to use. Returns:
The value of the minimum component.Source: Core/Cartesian4.js, line 240 -
staticCartesian4.lerp(start, end, t, result) → Cartesian4
-
Computes the linear interpolation or extrapolation at t using the provided cartesians.
Name Type Description startCartesian4 The value corresponding to t at 0.0. endCartesian4 The value corresponding to t at 1.0. tNumber The point along t at which to interpolate. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 619 -
staticCartesian4.magnitude(cartesian) → Number
-
Computes the Cartesian's magnitude (length).
Name Type Description cartesianCartesian4 The Cartesian instance whose magnitude is to be computed. Returns:
The magnitude.Source: Core/Cartesian4.js, line 336 -
staticCartesian4.magnitudeSquared(cartesian) → Number
-
Computes the provided Cartesian's squared magnitude.
Name Type Description cartesianCartesian4 The Cartesian instance whose squared magnitude is to be computed. Returns:
The squared magnitude.Source: Core/Cartesian4.js, line 319 -
staticCartesian4.mostOrthogonalAxis(cartesian, result) → Cartesian4
-
Returns the axis that is most orthogonal to the provided Cartesian.
Name Type Description cartesianCartesian4 The Cartesian on which to find the most orthogonal axis. resultCartesian4 optional The object onto which to store the result. Returns:
The most orthogonal axis.Source: Core/Cartesian4.js, line 646 -
staticCartesian4.multiplyByScalar(cartesian, scalar, result) → Cartesian4
-
Multiplies the provided Cartesian componentwise by the provided scalar.
Name Type Description cartesianCartesian4 The Cartesian to be scaled. scalarNumber The scalar to multiply with. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 509 -
staticCartesian4.multiplyComponents(left, right, result) → Cartesian4
-
Computes the componentwise product of two Cartesians.
Name Type Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 422 -
staticCartesian4.negate(cartesian, result) → Cartesian4
-
Negates the provided Cartesian.
Name Type Description cartesianCartesian4 The Cartesian to be negated. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 566 -
staticCartesian4.normalize(cartesian, result) → Cartesian4
-
Computes the normalized form of the supplied Cartesian.
Name Type Description cartesianCartesian4 The Cartesian to be normalized. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 374 -
staticCartesian4.pack(value, array, startingIndex)
-
Stores the provided instance into the provided array.
Name Type Default Description valueCartesian4 The value to pack. arrayNumber[] The array to pack into. startingIndexNumber 0optional The index into the array at which to start packing the elements. Source: Core/Cartesian4.js, line 147 -
staticCartesian4.subtract(left, right, result) → Cartesian4
-
Computes the componentwise difference of two Cartesians.
Name Type Description leftCartesian4 The first Cartesian. rightCartesian4 The second Cartesian. resultCartesian4 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian4 instance if one was not provided.Source: Core/Cartesian4.js, line 480 -
staticCartesian4.unpack(array, startingIndex, result)
-
Retrieves an instance from a packed array.
Name Type Default Description arrayNumber[] The packed array. startingIndexNumber 0optional The starting index of the element to be unpacked. resultCartesian4 optional The object into which to store the result. Source: Core/Cartesian4.js, line 174
