一个四维笛卡尔点。
Name | Type | Default | Description |
---|---|---|---|
x |
number |
0.0
|
optional X分量。 |
y |
number |
0.0
|
optional Y分量。 |
z |
number |
0.0
|
optional Z分量。 |
w |
number |
0.0
|
optional W分量。 |
See:
Members
W分量。
-
Default Value:
0.0
X分量。
-
Default Value:
0.0
Y分量。
-
Default Value:
0.0
Z分量。
-
Default Value:
0.0
static constant Cesium.Cartesian4.ONE : Cartesian4
初始化为的不可变Cartesian4实例 (1.0, 1.0, 1.0, 1.0).
用于将对象打包到数组中的元素数量。
static constant Cesium.Cartesian4.UNIT_W : Cartesian4
初始化为的不可变Cartesian4实例 (0.0, 0.0, 0.0, 1.0).
static constant Cesium.Cartesian4.UNIT_X : Cartesian4
初始化为的不可变Cartesian4实例 (1.0, 0.0, 0.0, 0.0).
static constant Cesium.Cartesian4.UNIT_Y : Cartesian4
初始化为的不可变Cartesian4实例 (0.0, 1.0, 0.0, 0.0).
static constant Cesium.Cartesian4.UNIT_Z : Cartesian4
初始化为的不可变Cartesian4实例 (0.0, 0.0, 1.0, 0.0).
static constant Cesium.Cartesian4.ZERO : Cartesian4
初始化为的不可变Cartesian4实例 (0.0, 0.0, 0.0, 0.0).
Methods
clone(result) → Cartesian4
复制Cartesian4 instance.
Name | Type | Description |
---|---|---|
result |
Cartesian4 | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或者一个新的笛卡尔实例,如果没有提供的话。
将此笛卡尔与提供的笛卡尔分量进行比较并返回
true
,否则为false
。
Name | Type | Description |
---|---|---|
right |
Cartesian4 | optional 右边 Cartesian. |
Returns:
true
,否则为false
。
将此笛卡尔与提供的笛卡尔分量进行比较并返回
true
如果它们通过了绝对或相对耐受性测试,
否则 false
。
Name | Type | Default | Description |
---|---|---|---|
right |
Cartesian4 | optional 右边 Cartesian. | |
relativeEpsilon |
number |
0
|
optional 用于相等性检验的相对容差。 |
absoluteEpsilon |
number |
relativeEpsilon
|
optional 用于相等性检验的绝对公差。 |
Returns:
true
如果它们在提供的epsilon内,否则 false
。
以'(x, y, z, w)'的格式创建一个表示此笛卡尔坐标的字符串。
Returns:
以'(x, y, z, w)'格式表示所提供的笛卡尔坐标的字符串。
static Cesium.Cartesian4.abs(cartesian, result) → Cartesian4
计算所提供的笛卡尔坐标的绝对值。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 要计算其绝对值的笛卡尔坐标系。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian4.add(left, right, result) → Cartesian4
计算两个笛卡尔坐标的分量和。
Name | Type | Description |
---|---|---|
left |
Cartesian4 | 第一个笛卡尔坐标系。 |
right |
Cartesian4 | 第二个笛卡尔坐标系。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian4.clamp(value, min, max, result) → Cartesian4
将一个值约束在两个值之间。
Name | Type | Description |
---|---|---|
value |
Cartesian4 | 夹位的值。 |
min |
Cartesian4 | 最小值。 |
max |
Cartesian4 | 最大值。 |
result |
Cartesian4 | 要在其中存储结果的对象。 |
Returns:
使min <= result <= max的固定值。
static Cesium.Cartesian4.clone(cartesian, result) → Cartesian4
复制Cartesian4 instance.
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 复制的笛卡尔坐标。 |
result |
Cartesian4 | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或者一个新的笛卡尔实例,如果没有提供的话。 (如果cartesian未定义则返回未定义)
Computes the 4-space distance between two points.
Name | Type | Description |
---|---|---|
left |
Cartesian4 | 第一个计算距离的点。 |
right |
Cartesian4 | 计算距离的第二个点。 |
Returns:
两点之间的距离
Example:
// Returns 1.0
const 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));
计算两点之间距离的平方。比较平方距离
使用此函数比使用
Cartesian4#distance
.
Name | Type | Description |
---|---|---|
left |
Cartesian4 | 第一个计算距离的点。 |
right |
Cartesian4 | 计算距离的第二个点。 |
Returns:
两点之间的距离
Example:
// Returns 4.0, not 2.0
const d = Cesium.Cartesian4.distance(
new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
static Cesium.Cartesian4.divideByScalar(cartesian, scalar, result) → Cartesian4
将给定的笛卡尔分量除以给定的标量。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 要划分的笛卡尔坐标。 |
scalar |
number | 要除以的标量。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian4.divideComponents(left, right, result) → Cartesian4
计算两个笛卡尔的分量商。
Name | Type | Description |
---|---|---|
left |
Cartesian4 | 第一个笛卡尔坐标系。 |
right |
Cartesian4 | 第二个笛卡尔坐标系。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
计算两个笛卡尔坐标的点(标量)积。
Name | Type | Description |
---|---|---|
left |
Cartesian4 | 第一个笛卡尔坐标系。 |
right |
Cartesian4 | 第二个笛卡尔坐标系。 |
Returns:
点积。
比较所提供的笛卡尔分量并返回
true
,否则为false
。
Name | Type | Description |
---|---|---|
left |
Cartesian4 | optional 第一个Cartesian. |
right |
Cartesian4 | optional 第二个 Cartesian. |
Returns:
true
如果左和右相等,否则false
。
比较所提供的笛卡尔分量并返回
true
如果它们通过了绝对或相对耐受性测试,
否则 false
。
Name | Type | Default | Description |
---|---|---|---|
left |
Cartesian4 | optional 第一个Cartesian. | |
right |
Cartesian4 | optional 第二个 Cartesian. | |
relativeEpsilon |
number |
0
|
optional 用于相等性检验的相对容差。 |
absoluteEpsilon |
number |
relativeEpsilon
|
optional 用于相等性检验的绝对公差。 |
Returns:
true
如果左和右在提供的epsilon内,否则 false
。
static Cesium.Cartesian4.fromArray(array, startingIndex, result) → Cartesian4
从数组中的四个连续元素创建一个笛卡尔坐标系。
Name | Type | Default | Description |
---|---|---|---|
array |
Array.<number> | 数组,其四个连续元素分别对应x、y、z和w个分量。 | |
startingIndex |
number |
0
|
optional 第一个元素在数组中的偏移量,对应于X分量。 |
result |
Cartesian4 | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或者一个新的笛卡尔实例,如果没有提供的话。
Example:
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
const v = [1.0, 2.0, 3.0, 4.0];
const p = Cesium.Cartesian4.fromArray(v);
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
const p2 = Cesium.Cartesian4.fromArray(v2, 2);
static Cesium.Cartesian4.fromColor(color, result) → Cartesian4
Name | Type | Description |
---|---|---|
color |
Color | 源颜色。 |
result |
Cartesian4 | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或者一个新的笛卡尔实例,如果没有提供的话。
static Cesium.Cartesian4.fromElements(x, y, z, w, result) → Cartesian4
从x、y、z和w坐标创建一个笛卡尔实例。
Name | Type | Description |
---|---|---|
x |
number | x坐标。 |
y |
number | y坐标。 |
z |
number | z坐标。 |
w |
number | Tw坐标。 |
result |
Cartesian4 | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或者一个新的笛卡尔实例,如果没有提供的话。
static Cesium.Cartesian4.lerp(start, end, t, result) → Cartesian4
使用提供的笛卡儿计算t处的线性插值或外推。
Name | Type | Description |
---|---|---|
start |
Cartesian4 | 对应于t在0.0处的值。 |
end |
Cartesian4 | 对应于1.0时t的值。 |
t |
number | 沿着t进行插值的点。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
计算笛卡尔的大小(长度)。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 要计算其大小的笛卡尔实例。 |
Returns:
的大小。
计算给定的笛卡尔坐标的平方幅度。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 要计算其模的平方的笛卡尔实例。 |
Returns:
大小的平方。
static Cesium.Cartesian4.maximumByComponent(first, second, result) → Cartesian4
比较两个笛卡尔坐标并计算一个包含所提供笛卡尔坐标的最大分量的笛卡尔坐标。
Name | Type | Description |
---|---|---|
first |
Cartesian4 | 用笛卡尔坐标来比较。 |
second |
Cartesian4 | 用笛卡尔坐标来比较。 |
result |
Cartesian4 | 要在其中存储结果的对象。 |
Returns:
A cartesian with the maximum components.
计算所提供的笛卡尔坐标的最大分量的值。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 用笛卡尔坐标。 |
Returns:
最大分量的值。
static Cesium.Cartesian4.minimumByComponent(first, second, result) → Cartesian4
比较两个笛卡尔坐标并计算一个包含所提供笛卡尔坐标的最小分量的笛卡尔坐标。
Name | Type | Description |
---|---|---|
first |
Cartesian4 | 用笛卡尔坐标来比较。 |
second |
Cartesian4 | 用笛卡尔坐标来比较。 |
result |
Cartesian4 | 要在其中存储结果的对象。 |
Returns:
具有最小分量的笛卡尔曲线。
为所提供的笛卡尔坐标计算最小分量的值。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 用笛卡尔坐标。 |
Returns:
最小分量的值。
static Cesium.Cartesian4.mostOrthogonalAxis(cartesian, result) → Cartesian4
返回与所提供的笛卡尔坐标最正交的轴。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 在笛卡尔坐标系上找到最正交的轴。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
最正交的轴。
static Cesium.Cartesian4.multiplyByScalar(cartesian, scalar, result) → Cartesian4
将所提供的笛卡尔分量与所提供的标量相乘。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 要缩放的笛卡尔坐标。 |
scalar |
number | 与之相乘的标量。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian4.multiplyComponents(left, right, result) → Cartesian4
计算两个笛卡尔坐标的分量积。
Name | Type | Description |
---|---|---|
left |
Cartesian4 | 第一个笛卡尔坐标系。 |
right |
Cartesian4 | 第二个笛卡尔坐标系。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian4.negate(cartesian, result) → Cartesian4
否定提供的笛卡尔坐标。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 笛卡尔坐标被否定了。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian4.normalize(cartesian, result) → Cartesian4
计算提供的笛卡尔坐标的规范化形式。
Name | Type | Description |
---|---|---|
cartesian |
Cartesian4 | 笛卡尔坐标被归一化。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
将提供的实例存储到提供的数组中。
Name | Type | Default | Description |
---|---|---|---|
value |
Cartesian4 | 要打包的值。 | |
array |
Array.<number> | 要装入的数组。 | |
startingIndex |
number |
0
|
optional 开始打包元素的数组的索引。 |
Returns:
被装入的数组
将笛Cartesian4的数组平展为一个分量数组。
Name | Type | Description |
---|---|---|
array |
Array.<Cartesian4> | 要打包的笛卡儿数组。 |
result |
Array.<number> |
optional
要在其中存储结果的数组。 如果这是一个类型化数组,它必须有array。array.length * 4个组件,否则将抛出DeveloperError 。如果它是一个常规数组,它的大小将被调整为(array.length * 4)元素。 |
Returns:
打包数组。
static Cesium.Cartesian4.packFloat(value, result) → Cartesian4
将任意浮点值打包为4个可使用uint8表示的值。
Name | Type | Description |
---|---|---|
value |
number | 浮点数。 |
result |
Cartesian4 | optional 将包含打包浮子的Cartesian4。 |
Returns:
一个笛卡尔坐标系4,表示浮点数被打包成x、y、z和w的值。
static Cesium.Cartesian4.subtract(left, right, result) → Cartesian4
计算两个笛卡尔坐标的分量差。
Name | Type | Description |
---|---|---|
left |
Cartesian4 | 第一个笛卡尔坐标系。 |
right |
Cartesian4 | 第二个笛卡尔坐标系。 |
result |
Cartesian4 | 要在其上存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Cartesian4.unpack(array, startingIndex, result) → Cartesian4
从打包数组中检索实例。
Name | Type | Default | Description |
---|---|---|---|
array |
Array.<number> | 打包数组。 | |
startingIndex |
number |
0
|
optional 要解压缩的元素的起始索引。 |
result |
Cartesian4 | optional 要在其中存储结果的对象。 |
Returns:
The modified result parameter 或者一个新的笛卡尔实例,如果没有提供的话。
static Cesium.Cartesian4.unpackArray(array, result) → Array.<Cartesian4>
将笛卡尔分量的数组解包为笛卡尔分量的数组。
Name | Type | Description |
---|---|---|
array |
Array.<number> | 要解包的组件数组。 |
result |
Array.<Cartesian4> | optional 要在其中存储结果的数组。 |
Returns:
未打包的数组。