三维笛卡尔点。
Name | Type | Default | Description |
---|---|---|---|
x |
Number |
0.0
|
optional X分量。 |
y |
Number |
0.0
|
optional Y分量。 |
z |
Number |
0.0
|
optional Z分量。 |
See:
Members
X分量。
-
Default Value:
0.0
Y分量。
-
Default Value:
0.0
Z分量。
-
Default Value:
0.0
用于将对象打包到数组中的元素数。
static constant Cesium.Cartesian3.UNIT_X : Cartesian3
初始化为(1.0,0.0,0.0)的不可变的Cartesian3实例。
static constant Cesium.Cartesian3.UNIT_Y : Cartesian3
初始化为(0.0,1.0,0.0)的不可变的Cartesian3实例。
static constant Cesium.Cartesian3.UNIT_Z : Cartesian3
初始化为(0.0,0.0,1.0)的不可变的Cartesian3实例。
static constant Cesium.Cartesian3.ZERO : Cartesian3
初始化为(0.0,0.0,0.0)的不可变的Cartesian3实例。
Methods
clone(result) → Cartesian3
复制此Cartesian3实例。
Name | Type | Description |
---|---|---|
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
修改后的result参数或新的Cartesian3实例(如果未提供实例)。
将此笛卡尔与提供的笛卡尔组件进行比较,然后返回
如果相等,则为
true
,否则为false
。Name | Type | Description |
---|---|---|
right |
Cartesian3 | optional 右手边的笛卡尔坐标。 |
Returns:
如果相等,则为
true
,否则为false
。将此笛卡尔与提供的笛卡尔组件进行比较,然后返回
true
如果它们通过绝对或相对公差测试,
false
否则。Name | Type | Default | Description |
---|---|---|---|
right |
Cartesian3 | optional 右手边的笛卡尔坐标。 | |
relativeEpsilon |
Number |
0
|
optional 用于相等性测试的相对ε公差。 |
absoluteEpsilon |
Number |
relativeEpsilon
|
optional 用于相等性测试的绝对ε公差。 |
Returns:
如果它们在规定的epsilon范围内,则为
true
,否则为false
。创建一个表示此笛卡尔坐标的字符串,格式为“(x,y,z)”。
Returns:
表示此笛卡尔坐标的字符串,格式为“(x,y,z)”。
static Cesium.Cartesian3.abs(cartesian, result) → Cartesian3
计算提供的笛卡尔坐标的绝对值。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 要计算其绝对值的笛卡尔坐标系。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian3.add(left, right, result) → Cartesian3
计算两个笛卡尔的分量和。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
返回提供的笛卡尔数之间的角度(以弧度为单位)。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
Returns:
笛卡尔人之间的夹角。
static Cesium.Cartesian3.clone(cartesian, result) → Cartesian3
复制卡特西亚诺3实例。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 要复制的笛卡尔坐标。 |
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
修改后的result参数或新的Cartesian3实例(如果未提供实例)。(如果笛卡尔未定义,则返回undefined)
static Cesium.Cartesian3.cross(left, right, result) → Cartesian3
计算两个笛卡尔的叉(外)积。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
交叉积。
计算两点之间的距离。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 计算距离的第一个点。 |
right |
Cartesian3 | 计算到的距离的第二个点。 |
Returns:
两点之间的距离。
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));
计算两点之间的平方距离。比较平方距离
使用此函数比使用
Cartesian3#distance
比较距离更有效。Name | Type | Description |
---|---|---|
left |
Cartesian3 | 计算距离的第一个点。 |
right |
Cartesian3 | 计算到的距离的第二个点。 |
Returns:
两点之间的距离。
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));
static Cesium.Cartesian3.divideByScalar(cartesian, scalar, result) → Cartesian3
将提供的笛卡尔组件除以提供的标量。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 要分割的笛卡尔坐标。 |
scalar |
Number | 要除以的标量。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian3.divideComponents(left, right, result) → Cartesian3
计算两个笛卡尔的分量商。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
计算两个笛卡尔的点(标量)积。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
Returns:
点积。
比较提供的Cartesians组件和返回
如果相等,则为
true
,否则为false
。Name | Type | Description |
---|---|---|
left |
Cartesian3 | optional 第一个笛卡尔。 |
right |
Cartesian3 | optional 第二个笛卡尔。 |
Returns:
如果左右相等,则为
true
,否则为false
。比较提供的Cartesians组件和返回
true
如果它们通过绝对或相对公差测试,
false
否则。Name | Type | Default | Description |
---|---|---|---|
left |
Cartesian3 | optional 第一个笛卡尔。 | |
right |
Cartesian3 | optional 第二个笛卡尔。 | |
relativeEpsilon |
Number |
0
|
optional 用于相等性测试的相对ε公差。 |
absoluteEpsilon |
Number |
relativeEpsilon
|
optional 用于相等性测试的绝对ε公差。 |
Returns:
true
如果左、右在规定的epsilon范围内,则为false
。static Cesium.Cartesian3.fromArray(array, startingIndex, result) → Cartesian3
从数组中的三个连续元素创建Cartesian3。
Name | Type | Default | Description |
---|---|---|---|
array |
Array.<Number> | 三个连续元素分别对应于x、y和z分量的数组。 | |
startingIndex |
Number |
0
|
optional 第一个元素的数组中的偏移量,它对应于x分量。 |
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
修改后的result参数或新的Cartesian3实例(如果未提供实例)。
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 Cesium.Cartesian3.fromCartesian4(cartesian, result) → Cartesian3
从现有的Cartesian4创建Cartesian3实例。这只需要
x、 Cartesian4和drops w的y,z性质。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 要从中创建Cartesian3实例的Cartesian4实例。 |
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
修改后的result参数或新的Cartesian3实例(如果未提供实例)。
static Cesium.Cartesian3.fromDegrees(longitude, latitude, height, ellipsoid, result) → Cartesian3
从给定的经度和纬度值返回Cartesian3位置。
Name | Type | Default | Description |
---|---|---|---|
longitude |
Number | 经度,以度为单位 | |
latitude |
Number | 纬度,以度为单位 | |
height |
Number |
0.0
|
optional 椭球面以上的高度,以米为单位。 |
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 位置所在的椭球体。 |
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
职位
Example:
var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
static Cesium.Cartesian3.fromDegreesArray(coordinates, ellipsoid, result) → Array.<Cartesian3>
返回给定经度和纬度值数组的Cartesian3位置数组。
Name | Type | Default | Description |
---|---|---|---|
coordinates |
Array.<Number> | 经度和纬度值的列表。值交替[经度,纬度,经度,纬度…]。 | |
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 坐标所在的椭球体。 |
result |
Array.<Cartesian3> | optional 用于存储结果的Cartesian3对象数组。 |
Returns:
位置的排列。
Example:
var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
static Cesium.Cartesian3.fromDegreesArrayHeights(coordinates, ellipsoid, result) → Array.<Cartesian3>
返回Cartesian3位置的数组,给定经度、纬度和高度值的数组,其中经度和纬度以度为单位。
Name | Type | Default | Description |
---|---|---|---|
coordinates |
Array.<Number> | 经度、纬度和高度值的列表。值交替[经度,纬度,高度,经度,纬度,高度…]。 | |
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 位置所在的椭球体。 |
result |
Array.<Cartesian3> | optional 用于存储结果的Cartesian3对象数组。 |
Returns:
位置的排列。
Example:
var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
static Cesium.Cartesian3.fromElements(x, y, z, result) → Cartesian3
从x、y和z坐标创建Cartesian3实例。
Name | Type | Description |
---|---|---|
x |
Number | x坐标。 |
y |
Number | y坐标。 |
z |
Number | z坐标。 |
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
修改后的result参数或新的Cartesian3实例(如果未提供实例)。
static Cesium.Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result) → Cartesian3
从以弧度表示的经度和纬度值返回Cartesian3位置。
Name | Type | Default | Description |
---|---|---|---|
longitude |
Number | 经度,以弧度表示 | |
latitude |
Number | 纬度,以弧度表示 | |
height |
Number |
0.0
|
optional 椭球面以上的高度,以米为单位。 |
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 位置所在的椭球体。 |
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
职位
Example:
var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
static Cesium.Cartesian3.fromRadiansArray(coordinates, ellipsoid, result) → Array.<Cartesian3>
返回以弧度表示的经度和纬度值数组的Cartesian3位置数组。
Name | Type | Default | Description |
---|---|---|---|
coordinates |
Array.<Number> | 经度和纬度值的列表。值交替[经度,纬度,经度,纬度…]。 | |
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 坐标所在的椭球体。 |
result |
Array.<Cartesian3> | optional 用于存储结果的Cartesian3对象数组。 |
Returns:
位置的排列。
Example:
var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
static Cesium.Cartesian3.fromRadiansArrayHeights(coordinates, ellipsoid, result) → Array.<Cartesian3>
返回Cartesian3位置的数组,给定经度、纬度和高度值的数组,其中经度和纬度以弧度表示。
Name | Type | Default | Description |
---|---|---|---|
coordinates |
Array.<Number> | 经度、纬度和高度值的列表。值交替[经度,纬度,高度,经度,纬度,高度…]。 | |
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 位置所在的椭球体。 |
result |
Array.<Cartesian3> | optional 用于存储结果的Cartesian3对象数组。 |
Returns:
位置的排列。
Example:
var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
static Cesium.Cartesian3.fromSpherical(spherical, result) → Cartesian3
将提供的球体转换为Cartesian3坐标。
Name | Type | Description |
---|---|---|
spherical |
Spherical | 要转换为笛卡尔3的球体。 |
result |
Cartesian3 | optional 要将结果存储到的对象。 |
Returns:
修改后的result参数或新的Cartesian3实例(如果未提供实例)。
static Cesium.Cartesian3.lerp(start, end, t, result) → Cartesian3
使用所提供的笛卡尔数来计算t处的线性插值或外推。
Name | Type | Description |
---|---|---|
start |
Cartesian3 | 在0.0处对应于t的值。 |
end |
Cartesian3 | 对应于1.0处的t的值。 |
t |
Number | 沿t插值的点。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
计算笛卡尔的大小(长度)。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 要计算其大小的笛卡尔实例。 |
Returns:
规模。
计算提供的笛卡尔平方量。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 要计算其平方大小的笛卡尔实例。 |
Returns:
平方大小。
static Cesium.Cartesian3.maximumByComponent(first, second, result) → Cartesian3
比较两个笛卡尔并计算包含所提供笛卡尔的最大分量的笛卡尔。
Name | Type | Description |
---|---|---|
first |
Cartesian3 | 一个笛卡尔比较。 |
second |
Cartesian3 | 一个笛卡尔比较。 |
result |
Cartesian3 | 要将结果存储到其中的对象。 |
Returns:
具有最大分量的笛卡尔坐标系。
计算所提供笛卡尔的最大分量的值。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 使用笛卡尔坐标。 |
Returns:
最大分量的值。
static Cesium.Cartesian3.midpoint(left, right, result) → Cartesian3
计算右笛卡尔和左笛卡尔的中点。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
中点。
static Cesium.Cartesian3.minimumByComponent(first, second, result) → Cartesian3
比较两个笛卡尔并计算包含所提供笛卡尔的最小分量的笛卡尔。
Name | Type | Description |
---|---|---|
first |
Cartesian3 | 一个笛卡尔比较。 |
second |
Cartesian3 | 一个笛卡尔比较。 |
result |
Cartesian3 | 要将结果存储到其中的对象。 |
Returns:
具有最小分量的笛卡尔坐标系。
计算所提供笛卡尔的最小分量的值。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 使用笛卡尔坐标。 |
Returns:
最小分量的值。
static Cesium.Cartesian3.mostOrthogonalAxis(cartesian, result) → Cartesian3
返回与提供的笛卡尔最正交的轴。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 在其上求最正交轴的笛卡尔坐标。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
最正交的轴。
static Cesium.Cartesian3.multiplyByScalar(cartesian, scalar, result) → Cartesian3
将提供的笛卡尔分量乘以提供的标量。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 要缩放的笛卡尔坐标。 |
scalar |
Number | 要乘的标量。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian3.multiplyComponents(left, right, result) → Cartesian3
计算两个笛卡尔的分量积。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian3.negate(cartesian, result) → Cartesian3
否定提供的笛卡尔坐标。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 笛卡尔被否定。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian3.normalize(cartesian, result) → Cartesian3
计算提供的笛卡尔的规范化形式。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian3 | 要规范化的笛卡尔坐标。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
将提供的实例存储到提供的数组中。
Name | Type | Default | Description |
---|---|---|---|
value |
Cartesian3 | 要打包的值。 | |
array |
Array.<Number> | 要打包到的数组。 | |
startingIndex |
Number |
0
|
optional 数组中开始打包元素的索引。 |
Returns:
被压缩到的数组
将cartesian3数组展平为一个组件数组。
Name | Type | Description |
---|---|---|
array |
Array.<Cartesian3> | 要打包的笛卡尔人阵列。 |
result |
Array.<Number> | optional
存储结果的数组。如果这是类型化数组,则它必须具有数组.长度*3个组件,否则将抛出一个DeveloperError 。如果它是一个常规数组,它将被调整为(数组.长度*3)元件。 |
Returns:
压缩数组。
static Cesium.Cartesian3.projectVector(a, b, result) → Cartesian3
将向量a投影到向量b上
Name | Type | Description |
---|---|---|
a |
Cartesian3 | 需要投影的向量 |
b |
Cartesian3 | 要投射到的向量 |
result |
Cartesian3 | 结果笛卡尔 |
Returns:
修改后的结果参数
static Cesium.Cartesian3.subtract(left, right, result) → Cartesian3
计算两个笛卡尔的分量差。
Name | Type | Description |
---|---|---|
left |
Cartesian3 | 第一个笛卡尔人。 |
right |
Cartesian3 | 第二个笛卡尔。 |
result |
Cartesian3 | 要存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian3.unpack(array, startingIndex, result) → Cartesian3
从压缩数组检索实例。
Name | Type | Default | Description |
---|---|---|---|
array |
Array.<Number> | 压缩数组。 | |
startingIndex |
Number |
0
|
optional 要解包的元素的起始索引。 |
result |
Cartesian3 | optional 要将结果存储到其中的对象。 |
Returns:
修改后的result参数或新的Cartesian3实例(如果未提供实例)。
static Cesium.Cartesian3.unpackArray(array, result) → Array.<Cartesian3>
将笛卡尔组件数组解压为笛卡尔3数组。
Name | Type | Description |
---|---|---|
array |
Array.<Number> | 要解压缩的组件数组。 |
result |
Array.<Cartesian3> | optional 存储结果的数组。 |
Returns:
未打包的数组。