new Cartesian3
A 3D 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. | 
See:
Source:
Members
- 
    
x :Number
 - 
    
    The X component.
- Default Value:
 - 0.0
 
 - 
    
y :Number
 - 
    
    The Y component.
- Default Value:
 - 0.0
 
 - 
    
z :Number
 - 
    
    The Z component.
- Default Value:
 - 0.0
 
 - 
    
<static> 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);
 - 
    
<static> packedLength :Number
 - 
    
    The number of elements used to pack the object into an array.
 - 
    
<static> UNIT_X
 - 
    
    An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
 - 
    
<static> UNIT_Y
 - 
    
    An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
 - 
    
<static> UNIT_Z
 - 
    
    An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
 - 
    
<static> ZERO
 - 
    
    An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
 
Methods
- 
    
clone
 - 
    
    
    
Duplicates this Cartesian3 instance.
Parameters:
Name Type Argument Description resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
equals
 - 
    
    
    
Compares this Cartesian against the provided Cartesian componentwise and returns
trueif they are equal,falseotherwise.Parameters:
Name Type Argument Description rightCartesian3 <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 rightCartesian3 <optional> 
The right hand side Cartesian. epsilonNumber The epsilon to use for equality testing. Returns:
Booleantrueif they are within the provided epsilon,falseotherwise. - 
    
toString
 - 
    
    
    
Creates a string representing this Cartesian in the format '(x, y, z)'.
Returns:
String A string representing this Cartesian in the format '(x, y, z)'. - 
    
<static> abs
 - 
    
    
    
Computes the absolute value of the provided Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian3 The Cartesian whose absolute value is to be computed. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> add
 - 
    
    
    
Computes the componentwise sum of two Cartesians.
Parameters:
Name Type Argument Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> angleBetween
 - 
    
    
    
Returns the angle, in radians, between the provided Cartesians.
Parameters:
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. Returns:
Number The angle between the Cartesians. - 
    
<static> clone
 - 
    
    
    
Duplicates a Cartesian3 instance.
Parameters:
Name Type Argument Description cartesianCartesian3 The Cartesian to duplicate. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined) - 
    
<static> cross
 - 
    
    
    
Computes the cross (outer) product of two Cartesians.
Parameters:
Name Type Argument Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The cross product. - 
    
<static> distance
 - 
    
    
    
Computes the distance between two points
Parameters:
Name Type Description leftCartesian3 The first point to compute the distance from. rightCartesian3 The second point to compute the distance to. Returns:
Number 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));
 - 
    
<static> divideByScalar
 - 
    
    
    
Divides the provided Cartesian componentwise by the provided scalar.
Parameters:
Name Type Argument Description cartesianCartesian3 The Cartesian to be divided. scalarNumber The scalar to divide by. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> dot
 - 
    
    
    
Computes the dot (scalar) product of two Cartesians.
Parameters:
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. Returns:
Number The dot product. - 
    
<static> equals
 - 
    
    
    
Compares the provided Cartesians componentwise and returns
trueif they are equal,falseotherwise.Parameters:
Name Type Argument Description leftCartesian3 <optional> 
The first Cartesian. rightCartesian3 <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 leftCartesian3 <optional> 
The first Cartesian. rightCartesian3 <optional> 
The second Cartesian. epsilonNumber The epsilon to use for equality testing. Returns:
Booleantrueif left and right are within the provided epsilon,falseotherwise. - 
    
<static> fromCartesian4
 - 
    
    
    
Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the x, y, and z properties of the Cartesian4 and drops w.
Parameters:
Name Type Argument Description cartesianCartesian4 The Cartesian4 instance to create a Cartesian3 instance from. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> fromElements
 - 
    
    
    
Creates a Cartesian3 instance from x, y and z coordinates.
Parameters:
Name Type Argument Description xNumber The x coordinate. yNumber The y coordinate. zNumber The z coordinate. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> fromSpherical
 - 
    
    
    
Converts the provided Spherical into Cartesian3 coordinates.
Parameters:
Name Type Argument Description sphericalSpherical The Spherical to be converted to Cartesian3. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> getMaximumByComponent
 - 
    
    
    
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
Parameters:
Name Type Argument Description firstCartesian3 A cartesian to compare. secondCartesian3 A cartesian to compare. resultCartesian3 <optional> 
The object into which to store the result. Returns:
Cartesian3 A cartesian with the maximum components. - 
    
<static> getMaximumComponent
 - 
    
    
    
Computes the value of the maximum component for the supplied Cartesian.
Parameters:
Name Type Description TheCartesian3 cartesian to use. Returns:
Number The value of the maximum component. - 
    
<static> getMinimumByComponent
 - 
    
    
    
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
Parameters:
Name Type Argument Description firstCartesian3 A cartesian to compare. secondCartesian3 A cartesian to compare. resultCartesian3 <optional> 
The object into which to store the result. Returns:
Cartesian3 A cartesian with the minimum components. - 
    
<static> getMinimumComponent
 - 
    
    
    
Computes the value of the minimum component for the supplied Cartesian.
Parameters:
Name Type Description TheCartesian3 cartesian to use. 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. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> magnitude
 - 
    
    
    
Computes the Cartesian's magnitude (length).
Parameters:
Name Type Description cartesianCartesian3 The Cartesian instance whose magnitude is to be computed. Returns:
Number The magnitude. - 
    
<static> magnitudeSquared
 - 
    
    
    
Computes the provided Cartesian's squared magnitude.
Parameters:
Name Type Description cartesianCartesian3 The Cartesian instance whose squared magnitude is to be computed. Returns:
Number The squared magnitude. - 
    
<static> mostOrthogonalAxis
 - 
    
    
    
Returns the axis that is most orthogonal to the provided Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian3 The Cartesian on which to find the most orthogonal axis. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The most orthogonal axis. - 
    
<static> multiplyByScalar
 - 
    
    
    
Multiplies the provided Cartesian componentwise by the provided scalar.
Parameters:
Name Type Argument Description cartesianCartesian3 The Cartesian to be scaled. scalarNumber The scalar to multiply with. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> multiplyComponents
 - 
    
    
    
Computes the componentwise product of two Cartesians.
Parameters:
Name Type Argument Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> negate
 - 
    
    
    
Negates the provided Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian3 The Cartesian to be negated. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> normalize
 - 
    
    
    
Computes the normalized form of the supplied Cartesian.
Parameters:
Name Type Argument Description cartesianCartesian3 The Cartesian to be normalized. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> pack
 - 
    
    
    
Stores the provided instance into the provided array.
Parameters:
Name Type Argument Default Description valueCartesian3 The value to pack. arrayArray The array to pack into. startingIndexNumber <optional> 
0 The index into the array at which to start packing the elements.  - 
    
<static> subtract
 - 
    
    
    
Computes the componentwise difference of two Cartesians.
Parameters:
Name Type Argument Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 <optional> 
The object onto which to store the result. Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided. - 
    
<static> unpack
 - 
    
    
    
Retrieves an instance from a packed array.
Parameters:
Name Type Argument Default Description arrayArray The packed array. startingIndexNumber <optional> 
0 The starting index of the element to be unpacked. resultCartesian3 <optional> 
The object into which to store the result.  
