三维笛卡尔坐标点。
| Name | Type | Default | Description |
|---|---|---|---|
x |
Number |
0.0
|
optional The X 分量。 |
y |
Number |
0.0
|
optional The Y 分量。 |
z |
Number |
0.0
|
optional The Z 分量。 |
See:
Members
-
X分量。
-
Default Value:
0.0 -
Y分量。
-
Default Value:
0.0 -
Z分量。
-
Default Value:
0.0 -
The number of elements used to pack the object into an array.
-
staticconstantCesium.Cartesian3.UNIT_X : Cartesian3
-
An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
-
staticconstantCesium.Cartesian3.UNIT_Y : Cartesian3
-
An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
-
staticconstantCesium.Cartesian3.UNIT_Z : Cartesian3
-
An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
-
staticconstantCesium.Cartesian3.ZERO : Cartesian3
-
An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
Methods
-
clone(result) → Cartesian3
-
Duplicates this Cartesian3 instance.
Name Type Description resultCartesian3 optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided. -
Compares this Cartesian against the provided Cartesian componentwise and returns
trueif they are equal,falseotherwise.Name Type Description rightCartesian3 optional The right hand side Cartesian. Returns:
trueif they are equal,falseotherwise. -
Compares this Cartesian against the provided Cartesian componentwise and returns
trueif they pass an absolute or relative tolerance test,falseotherwise.Name Type Default Description rightCartesian3 optional The right hand side Cartesian. relativeEpsilonNumber The relative epsilon tolerance to use for equality testing. absoluteEpsilonNumber relativeEpsilonoptional The absolute epsilon tolerance to use for equality testing. Returns:
trueif they are within the provided epsilon,falseotherwise. -
将笛卡尔坐标转换为字符串格式的(x, y, z)。
-
staticCesium.Cartesian3.abs(cartesian, result) → Cartesian3
-
Computes the absolute value of the provided Cartesian.
Name Type Description cartesianCartesian3 The Cartesian whose absolute value is to be computed. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
staticCesium.Cartesian3.add(left, right, result) → Cartesian3
-
Computes the componentwise sum of two Cartesians.
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
Returns the angle, in radians, between the provided Cartesians.
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. Returns:
The angle between the Cartesians. -
staticCesium.Cartesian3.clone(cartesian, result) → Cartesian3
-
复制一个Cartesian3实例。
Name Type Description cartesianCartesian3 待复制对象。 resultCartesian3 optional 存储结果的对象。 Returns:
经修改的结果参数,如果没有提供则返回一个新的Cartesian3实例。如果cartesian未定义,则返回undefined。 -
staticCesium.Cartesian3.cross(left, right, result) → Cartesian3
-
Computes the cross (outer) product of two Cartesians.
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 The object onto which to store the result. Returns:
The cross product. -
计算两点的距离。
Name Type Description leftCartesian3 用于计算距离的第一个点。 rightCartesian3 用于计算距离的第二个点。 Returns:
两点间距离值。Example:
// 计算两点的距离,返回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)); -
Computes the squared distance between two points. Comparing squared distances using this function is more efficient than comparing distances using
Cartesian3#distance.Name Type Description leftCartesian3 The first point to compute the distance from. rightCartesian3 The second point to compute the distance to. Returns:
The distance between two points.Example:
// Returns 4.0, not 2.0 var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); -
staticCesium.Cartesian3.divideByScalar(cartesian, scalar, result) → Cartesian3
-
Divides the provided Cartesian componentwise by the provided scalar.
Name Type Description cartesianCartesian3 The Cartesian to be divided. scalarNumber The scalar to divide by. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
staticCesium.Cartesian3.divideComponents(left, right, result) → Cartesian3
-
Computes the componentwise quotient of two Cartesians.
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
Computes the dot (scalar) product of two Cartesians.
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. Returns:
The dot product. -
Compares the provided Cartesians componentwise and returns
trueif they are equal,falseotherwise.Name Type Description leftCartesian3 optional The first Cartesian. rightCartesian3 optional The second Cartesian. Returns:
trueif left and right are equal,falseotherwise. -
Compares the provided Cartesians componentwise and returns
trueif they pass an absolute or relative tolerance test,falseotherwise.Name Type Default Description leftCartesian3 optional The first Cartesian. rightCartesian3 optional The second Cartesian. relativeEpsilonNumber The relative epsilon tolerance to use for equality testing. absoluteEpsilonNumber relativeEpsilonoptional The absolute epsilon tolerance to use for equality testing. Returns:
trueif left and right are within the provided epsilon,falseotherwise. -
staticCesium.Cartesian3.fromArray(array, startingIndex, result) → Cartesian3
-
根据数组的三个连续元素创建Cartesian3实例。
Name Type Default Description arrayArray.<Number> 数组对象,数组中的三个连续元素分别对应x、y、z分量。 startingIndexNumber 0optional 第一个元素在数组中的偏移量,即数组的第"startingIndex+1"个元素对应x分量。 resultCartesian3 optional 存储结果的对象。 Returns:
经修改的结果参数,如果没有提供则返回一个新的Cartesian3实例。Example:
//创建Cartesian3实例(1.0, 2.0, 3.0)。 var v = [1.0, 2.0, 3.0]; var p = Cesium.Cartesian3.fromArray(v); // 创建Cartesian3实例(1.0, 2.0, 3.0),指定偏移量为2,则第3个数据对应着x分量。 var v2 = [0.0, 0.0, 1.0, 2.0, 3.0]; var p2 = Cesium.Cartesian3.fromArray(v2, 2); -
staticCesium.Cartesian3.fromCartesian4(cartesian, result) → Cartesian3
-
根据已知的Cartesian4创建一个Cartesian3实例。将保留Cartesian4的x、y、z分量,舍去w分量。
Name Type Description cartesianCartesian4 用于创建Cartesian3实例的Cartesian4对象。 resultCartesian3 optional 用于存储结果的对象。 Returns:
经修改的结果参数,如果没有提供则返回一个新的Cartesian3实例。 -
staticCesium.Cartesian3.fromDegrees(longitude, latitude, height, ellipsoid, result) → Cartesian3
-
将以度为单位的经、纬度数值转换为笛卡尔坐标。
Name Type Default Description longitudeNumber 以度为单位的经度值。 latitudeNumber 以度为单位的纬度值。 heightNumber 0.0optional 以米为单位的椭球高。 ellipsoidEllipsoid Ellipsoid.WGS84optional 椭球体。 resultCartesian3 optional 用于存储结果的对象。 Returns:
转换后的位置坐标。Example:
var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); -
staticCesium.Cartesian3.fromDegreesArray(coordinates, ellipsoid, result) → Array.<Cartesian3>
-
Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
Name Type Default Description coordinatesArray.<Number> A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...]. ellipsoidEllipsoid Ellipsoid.WGS84optional The ellipsoid on which the coordinates lie. resultArray.<Cartesian3> optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); -
staticCesium.Cartesian3.fromDegreesArrayHeights(coordinates, ellipsoid, result) → Array.<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 coordinatesArray.<Number> A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...]. ellipsoidEllipsoid Ellipsoid.WGS84optional The ellipsoid on which the position lies. resultArray.<Cartesian3> optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); -
staticCesium.Cartesian3.fromElements(x, y, z, result) → Cartesian3
-
根据x、y、z坐标创建Cartesian3实例。
Name Type Description xNumber x坐标。 yNumber y坐标。 zNumber z坐标。 resultCartesian3 optional 存储结果的对象。 Returns:
经修改的结果参数,如果没有提供则返回一个新的Cartesian3实例。 -
staticCesium.Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result) → Cartesian3
-
将以弧度为单位的经、纬度数值转换为笛卡尔坐标。
Name Type Default Description longitudeNumber 以弧度为单位的经度值。 latitudeNumber 以弧度为单位的纬度值。 heightNumber 0.0optional 以米为单位的椭球高。 ellipsoidEllipsoid Ellipsoid.WGS84optional 椭球体。 resultCartesian3 optional 用于存储结果的对象。 Returns:
转换后的位置坐标。Example:
var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); -
staticCesium.Cartesian3.fromRadiansArray(coordinates, ellipsoid, result) → Array.<Cartesian3>
-
Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
Name Type Default Description coordinatesArray.<Number> A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...]. ellipsoidEllipsoid Ellipsoid.WGS84optional The ellipsoid on which the coordinates lie. resultArray.<Cartesian3> optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); -
staticCesium.Cartesian3.fromRadiansArrayHeights(coordinates, ellipsoid, result) → Array.<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 coordinatesArray.<Number> A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...]. ellipsoidEllipsoid Ellipsoid.WGS84optional The ellipsoid on which the position lies. resultArray.<Cartesian3> optional An array of Cartesian3 objects to store the result. Returns:
The array of positions.Example:
var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); -
staticCesium.Cartesian3.fromSpherical(spherical, result) → Cartesian3
-
将球面坐标转换为笛卡尔坐标。
Name Type Description sphericalSpherical 待转换的球面坐标。 resultCartesian3 optional 存储结果的对象。 Returns:
经修改的结果参数,如果没有提供则返回一个新的Cartesian3实例。 -
staticCesium.Cartesian3.lerp(start, end, t, result) → Cartesian3
-
Computes the linear interpolation or extrapolation at t using the provided cartesians.
Name Type Description startCartesian3 The value corresponding to t at 0.0. endCartesian3 The value corresponding to t at 1.0. tNumber The point along t at which to interpolate. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
Computes the Cartesian's magnitude (length).
Name Type Description cartesianCartesian3 The Cartesian instance whose magnitude is to be computed. Returns:
The magnitude. -
Computes the provided Cartesian's squared magnitude.
Name Type Description cartesianCartesian3 The Cartesian instance whose squared magnitude is to be computed. Returns:
The squared magnitude. -
staticCesium.Cartesian3.maximumByComponent(first, second, result) → Cartesian3
-
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
Name Type Description firstCartesian3 A cartesian to compare. secondCartesian3 A cartesian to compare. resultCartesian3 The object into which to store the result. Returns:
A cartesian with the maximum components. -
Computes the value of the maximum component for the supplied Cartesian.
Name Type Description cartesianCartesian3 The cartesian to use. Returns:
The value of the maximum component. -
staticCesium.Cartesian3.minimumByComponent(first, second, result) → Cartesian3
-
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
Name Type Description firstCartesian3 A cartesian to compare. secondCartesian3 A cartesian to compare. resultCartesian3 The object into which to store the result. Returns:
A cartesian with the minimum components. -
Computes the value of the minimum component for the supplied Cartesian.
Name Type Description cartesianCartesian3 The cartesian to use. Returns:
The value of the minimum component. -
staticCesium.Cartesian3.mostOrthogonalAxis(cartesian, result) → Cartesian3
-
Returns the axis that is most orthogonal to the provided Cartesian.
Name Type Description cartesianCartesian3 The Cartesian on which to find the most orthogonal axis. resultCartesian3 The object onto which to store the result. Returns:
The most orthogonal axis. -
staticCesium.Cartesian3.multiplyByScalar(cartesian, scalar, result) → Cartesian3
-
Multiplies the provided Cartesian componentwise by the provided scalar.
Name Type Description cartesianCartesian3 The Cartesian to be scaled. scalarNumber The scalar to multiply with. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
staticCesium.Cartesian3.multiplyComponents(left, right, result) → Cartesian3
-
Computes the componentwise product of two Cartesians.
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
staticCesium.Cartesian3.negate(cartesian, result) → Cartesian3
-
Negates the provided Cartesian.
Name Type Description cartesianCartesian3 The Cartesian to be negated. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
staticCesium.Cartesian3.normalize(cartesian, result) → Cartesian3
-
Computes the normalized form of the supplied Cartesian.
Name Type Description cartesianCartesian3 The Cartesian to be normalized. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
Stores the provided instance into the provided array.
Name Type Default Description valueCartesian3 The value to pack. arrayArray.<Number> The array to pack into. startingIndexNumber 0optional The index into the array at which to start packing the elements. Returns:
The array that was packed into -
Flattens an array of Cartesian3s into an array of components.
Name Type Description arrayArray.<Cartesian3> The array of cartesians to pack. resultArray.<Number> The array onto which to store the result. Returns:
The packed array. -
staticCesium.Cartesian3.subtract(left, right, result) → Cartesian3
-
Computes the componentwise difference of two Cartesians.
Name Type Description leftCartesian3 The first Cartesian. rightCartesian3 The second Cartesian. resultCartesian3 The object onto which to store the result. Returns:
The modified result parameter. -
staticCesium.Cartesian3.unpack(array, startingIndex, result) → Cartesian3
-
Retrieves an instance from a packed array.
Name Type Default Description arrayArray.<Number> The packed array. startingIndexNumber 0optional The starting index of the element to be unpacked. resultCartesian3 optional The object into which to store the result. Returns:
The modified result parameter or a new Cartesian3 instance if one was not provided. -
staticCesium.Cartesian3.unpackArray(array, result) → Array.<Cartesian3>
-
Unpacks an array of cartesian components into an array of Cartesian3s.
Name Type Description arrayArray.<Number> The array of components to unpack. resultArray.<Cartesian3> The array onto which to store the result. Returns:
The unpacked array.
