new Cartesian3(x, y, z)
A 3D 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. |
See:
Source:
Core/Cartesian3.js, line 29
Members
-
x :Number
-
The X component.
-
Default Value:
0.0
Source: Core/Cartesian3.js, line 35 -
y :Number
-
The Y component.
-
Default Value:
0.0
Source: Core/Cartesian3.js, line 42 -
z :Number
-
The Z component.
-
Default Value:
0.0
Source: Core/Cartesian3.js, line 49 -
staticCartesian3.fromArray
-
Creates a Cartesian3 from three consecutive elements in an array.
Example:
// Create a Cartesian3 with (1.0, 2.0, 3.0) var v = [1.0, 2.0, 3.0]; var p = Cesium.Cartesian3.fromArray(v); // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array var v2 = [0.0, 0.0, 1.0, 2.0, 3.0]; var p2 = Cesium.Cartesian3.fromArray(v2, 2);
Source: Core/Cartesian3.js, line 212 -
staticCartesian3.packedLength :Number
-
The number of elements used to pack the object into an array.Source: Core/Cartesian3.js, line 139
-
staticCartesian3.UNIT_X
-
An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).Source: Core/Cartesian3.js, line 1004
-
staticCartesian3.UNIT_Y
-
An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).Source: Core/Cartesian3.js, line 1010
-
staticCartesian3.UNIT_Z
-
An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).Source: Core/Cartesian3.js, line 1016
-
staticCartesian3.ZERO
-
An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).Source: Core/Cartesian3.js, line 998
Methods
-
clone(result) → Cartesian3
-
Duplicates this Cartesian3 instance.
Name Type Description result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 1025 -
equals(right) → Boolean
-
Compares this Cartesian against the provided Cartesian componentwise and returns
true
if they are equal,false
otherwise.Name Type Description right
Cartesian3 optional The right hand side Cartesian. Returns:
true
if they are equal,false
otherwise.Source: Core/Cartesian3.js, line 1037 -
equalsEpsilon(right, epsilon) → Boolean
-
Compares this Cartesian against the provided Cartesian componentwise and returns
true
if they are within the provided epsilon,false
otherwise.Name Type Description right
Cartesian3 optional The right hand side Cartesian. epsilon
Number The epsilon to use for equality testing. Returns:
true
if they are within the provided epsilon,false
otherwise.Source: Core/Cartesian3.js, line 1051 -
toString() → String
-
Creates a string representing this Cartesian in the format '(x, y, z)'.
Returns:
A string representing this Cartesian in the format '(x, y, z)'.Source: Core/Cartesian3.js, line 1061 -
staticCartesian3.abs(cartesian, result) → Cartesian3
-
Computes the absolute value of the provided Cartesian.
Name Type Description cartesian
Cartesian3 The Cartesian whose absolute value is to be computed. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 579 -
staticCartesian3.add(left, right, result) → Cartesian3
-
Computes the componentwise sum of two Cartesians.
Name Type Description left
Cartesian3 The first Cartesian. right
Cartesian3 The second Cartesian. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 444 -
staticCartesian3.angleBetween(left, right) → Number
-
Returns the angle, in radians, between the provided Cartesians.
Name Type Description left
Cartesian3 The first Cartesian. right
Cartesian3 The second Cartesian. Returns:
The angle between the Cartesians.Source: Core/Cartesian3.js, line 634 -
staticCartesian3.clone(cartesian, result) → Cartesian3
-
Duplicates a Cartesian3 instance.
Name Type Description cartesian
Cartesian3 The Cartesian to duplicate. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)Source: Core/Cartesian3.js, line 109 -
staticCartesian3.cross(left, right, result) → Cartesian3
-
Computes the cross (outer) product of two Cartesians.
Name Type Description left
Cartesian3 The first Cartesian. right
Cartesian3 The second Cartesian. result
Cartesian3 optional The object onto which to store the result. Returns:
The cross product.Source: Core/Cartesian3.js, line 740 -
staticCartesian3.distance(left, right) → Number
-
Computes the distance between two points
Name Type Description left
Cartesian3 The first point to compute the distance from. right
Cartesian3 The second point to compute the distance to. Returns:
The distance between two points.Example:
// Returns 1.0 var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
Source: Core/Cartesian3.js, line 350 -
staticCartesian3.divideByScalar(cartesian, scalar, result) → Cartesian3
-
Divides the provided Cartesian componentwise by the provided scalar.
Name Type Description cartesian
Cartesian3 The Cartesian to be divided. scalar
Number The scalar to divide by. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 528 -
staticCartesian3.dot(left, right) → Number
-
Computes the dot (scalar) product of two Cartesians.
Name Type Description left
Cartesian3 The first Cartesian. right
Cartesian3 The second Cartesian. Returns:
The dot product.Source: Core/Cartesian3.js, line 394 -
staticCartesian3.equals(left, right) → Boolean
-
Compares the provided Cartesians componentwise and returns
true
if they are equal,false
otherwise.Name Type Description left
Cartesian3 optional The first Cartesian. right
Cartesian3 optional The second Cartesian. Returns:
true
if left and right are equal,false
otherwise.Source: Core/Cartesian3.js, line 696 -
staticCartesian3.equalsEpsilon(left, right, epsilon) → Boolean
-
Compares the provided Cartesians componentwise and returns
true
if they are within the provided epsilon,false
otherwise.Name Type Description left
Cartesian3 optional The first Cartesian. right
Cartesian3 optional The second Cartesian. epsilon
Number The epsilon to use for equality testing. Returns:
true
if left and right are within the provided epsilon,false
otherwise.Source: Core/Cartesian3.js, line 716 -
staticCartesian3.fromCartesian4(cartesian, result) → Cartesian3
-
Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the x, y, and z properties of the Cartesian4 and drops w.
Name Type Description cartesian
Cartesian4 The Cartesian4 instance to create a Cartesian3 instance from. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 133 -
staticCartesian3.fromDegrees(longitude, latitude, height, ellipsoid, result) → Cartesian3
-
Returns a Cartesian3 position from longitude and latitude values given in degrees.
Name Type Default Description longitude
Number The longitude, in degrees latitude
Number The latitude, in degrees height
Number 0.0
optional The height, in meters, above the ellipsoid. ellipsoid
Ellipsoid Ellipsoid.WGS84
optional The ellipsoid on which the position lies. result
Cartesian3 optional The object onto which to store the result. Returns:
The positionExample:
var position = Cartesian3.fromDegrees(-115.0, 37.0);
Source: Core/Cartesian3.js, line 785 -
staticCartesian3.fromDegreesArray(coordinates, ellipsoid, result) → Cartesian3[]
-
Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
Name Type Default Description coordinates
Number[] A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...]. ellipsoid
Ellipsoid Ellipsoid.WGS84
optional The ellipsoid on which the coordinates lie. result
Cartesian3[] optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
Source: Core/Cartesian3.js, line 858 -
staticCartesian3.fromDegreesArrayHeights(coordinates, ellipsoid, result) → Cartesian3[]
-
Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
Name Type Default Description coordinates
Number[] A list of longitude, latitude and height values. Values alternate [longitude, latitude, height,, longitude, latitude, height...]. ellipsoid
Ellipsoid Ellipsoid.WGS84
optional The ellipsoid on which the position lies. result
Cartesian3[] optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
Source: Core/Cartesian3.js, line 928 -
staticCartesian3.fromElements(x, y, z, result) → Cartesian3
-
Creates a Cartesian3 instance from x, y and z coordinates.
Name Type Description x
Number The x coordinate. y
Number The y coordinate. z
Number The z coordinate. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 90 -
staticCartesian3.fromRadians(longitude, latitude, height, ellipsoid, result) → Cartesian3
-
Returns a Cartesian3 position from longitude and latitude values given in radians.
Name Type Default Description longitude
Number The longitude, in radians latitude
Number The latitude, in radians height
Number 0.0
optional The height, in meters, above the ellipsoid. ellipsoid
Ellipsoid Ellipsoid.WGS84
optional The ellipsoid on which the position lies. result
Cartesian3 optional The object onto which to store the result. Returns:
The positionExample:
var position = Cartesian3.fromRadians(-2.007, 0.645);
Source: Core/Cartesian3.js, line 819 -
staticCartesian3.fromRadiansArray(coordinates, ellipsoid, result) → Cartesian3[]
-
Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
Name Type Default Description coordinates
Number[] A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...]. ellipsoid
Ellipsoid Ellipsoid.WGS84
optional The ellipsoid on which the coordinates lie. result
Cartesian3[] optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
Source: Core/Cartesian3.js, line 886 -
staticCartesian3.fromRadiansArrayHeights(coordinates, ellipsoid, result) → Cartesian3[]
-
Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
Name Type Default Description coordinates
Number[] A list of longitude, latitude and height values. Values alternate [longitude, latitude, height,, longitude, latitude, height...]. ellipsoid
Ellipsoid Ellipsoid.WGS84
optional The ellipsoid on which the position lies. result
Cartesian3[] optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cartesian3.fromradiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
Source: Core/Cartesian3.js, line 964 -
staticCartesian3.fromSpherical(spherical, result) → Cartesian3
-
Converts the provided Spherical into Cartesian3 coordinates.
Name Type Description spherical
Spherical The Spherical to be converted to Cartesian3. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 60 -
staticCartesian3.getMaximumByComponent(first, second, result) → Cartesian3
-
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
Name Type Description first
Cartesian3 A cartesian to compare. second
Cartesian3 A cartesian to compare. result
Cartesian3 optional The object into which to store the result. Returns:
A cartesian with the maximum components.Source: Core/Cartesian3.js, line 287 -
staticCartesian3.getMaximumComponent(cartesian) → Number
-
Computes the value of the maximum component for the supplied Cartesian.
Name Type Description cartesian
Cartesian3 The cartesian to use. Returns:
The value of the maximum component.Source: Core/Cartesian3.js, line 221 -
staticCartesian3.getMinimumByComponent(first, second, result) → Cartesian3
-
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
Name Type Description first
Cartesian3 A cartesian to compare. second
Cartesian3 A cartesian to compare. result
Cartesian3 optional The object into which to store the result. Returns:
A cartesian with the minimum components.Source: Core/Cartesian3.js, line 257 -
staticCartesian3.getMinimumComponent(cartesian) → Number
-
Computes the value of the minimum component for the supplied Cartesian.
Name Type Description cartesian
Cartesian3 The cartesian to use. Returns:
The value of the minimum component.Source: Core/Cartesian3.js, line 238 -
staticCartesian3.lerp(start, end, t, result) → Cartesian3
-
Computes the linear interpolation or extrapolation at t using the provided cartesians.
Name Type Description start
Cartesian3 The value corresponding to t at 0.0. end
Cartesian3 The value corresponding to t at 1.0. t
Number The point along t at which to interpolate. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 606 -
staticCartesian3.magnitude(cartesian) → Number
-
Computes the Cartesian's magnitude (length).
Name Type Description cartesian
Cartesian3 The Cartesian instance whose magnitude is to be computed. Returns:
The magnitude.Source: Core/Cartesian3.js, line 331 -
staticCartesian3.magnitudeSquared(cartesian) → Number
-
Computes the provided Cartesian's squared magnitude.
Name Type Description cartesian
Cartesian3 The Cartesian instance whose squared magnitude is to be computed. Returns:
The squared magnitude.Source: Core/Cartesian3.js, line 314 -
staticCartesian3.mostOrthogonalAxis(cartesian, result) → Cartesian3
-
Returns the axis that is most orthogonal to the provided Cartesian.
Name Type Description cartesian
Cartesian3 The Cartesian on which to find the most orthogonal axis. result
Cartesian3 optional The object onto which to store the result. Returns:
The most orthogonal axis.Source: Core/Cartesian3.js, line 660 -
staticCartesian3.multiplyByScalar(cartesian, scalar, result) → Cartesian3
-
Multiplies the provided Cartesian componentwise by the provided scalar.
Name Type Description cartesian
Cartesian3 The Cartesian to be scaled. scalar
Number The scalar to multiply with. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 500 -
staticCartesian3.multiplyComponents(left, right, result) → Cartesian3
-
Computes the componentwise product of two Cartesians.
Name Type Description left
Cartesian3 The first Cartesian. right
Cartesian3 The second Cartesian. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 416 -
staticCartesian3.negate(cartesian, result) → Cartesian3
-
Negates the provided Cartesian.
Name Type Description cartesian
Cartesian3 The Cartesian to be negated. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 555 -
staticCartesian3.normalize(cartesian, result) → Cartesian3
-
Computes the normalized form of the supplied Cartesian.
Name Type Description cartesian
Cartesian3 The Cartesian to be normalized. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 369 -
staticCartesian3.pack(value, array, startingIndex)
-
Stores the provided instance into the provided array.
Name Type Default Description value
Cartesian3 The value to pack. array
Number[] The array to pack into. startingIndex
Number 0
optional The index into the array at which to start packing the elements. Source: Core/Cartesian3.js, line 149 -
staticCartesian3.subtract(left, right, result) → Cartesian3
-
Computes the componentwise difference of two Cartesians.
Name Type Description left
Cartesian3 The first Cartesian. right
Cartesian3 The second Cartesian. result
Cartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided.Source: Core/Cartesian3.js, line 472 -
staticCartesian3.unpack(array, startingIndex, result)
-
Retrieves an instance from a packed array.
Name Type Default Description array
Number[] The packed array. startingIndex
Number 0
optional The starting index of the element to be unpacked. result
Cartesian3 optional The object into which to store the result. Source: Core/Cartesian3.js, line 175