2x2 矩阵,可作为列主序数组进行索引。为了代码的可读性,构造函数参数按行优先顺序排列。 A 2x2 matrix, indexable as a column-major order array. Constructor parameters are in row-major order for code readability.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
column0Row0 |
number |
0.0
|
可选 optional 第 0 列、第 0 行的值。 The value for column 0, row 0. |
column1Row0 |
number |
0.0
|
可选 optional 第 1 列第 0 行的值。 The value for column 1, row 0. |
column0Row1 |
number |
0.0
|
可选 optional 第 0 列第 1 行的值。 The value for column 0, row 1. |
column1Row1 |
number |
0.0
|
可选 optional 第 1 列、第 1 行的值。 The value for column 1, row 1. |
成员 Members
获取集合中的项目数。 Gets the number of items in the collection.
Matrix2 第 0 列、第 0 行的索引。 The index into Matrix2 for column 0, row 0.
示例: Example:
const matrix = new Cesium.Matrix2();
matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
Matrix2 第 0 列、第 1 行的索引。 The index into Matrix2 for column 0, row 1.
示例: Example:
const matrix = new Cesium.Matrix2();
matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
Matrix2 第 1 列、第 0 行的索引。 The index into Matrix2 for column 1, row 0.
示例: Example:
const matrix = new Cesium.Matrix2();
matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
Matrix2 第 1 列、第 1 行的索引。 The index into Matrix2 for column 1, row 1.
示例: Example:
const matrix = new Cesium.Matrix2();
matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
static constant Cesium.Matrix2.IDENTITY : Matrix2
一个不可变的 Matrix2 实例初始化为单位矩阵。 An immutable Matrix2 instance initialized to the identity matrix.
用于将对象打包到数组中的元素数量。 The number of elements used to pack the object into an array.
static constant Cesium.Matrix2.ZERO : Matrix2
一个不可变的 Matrix2 实例初始化为零矩阵。 An immutable Matrix2 instance initialized to the zero matrix.
方法 Methods
clone(result) → Matrix2
Duplicates the provided Matrix2 instance.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
result |
Matrix2 | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的 Matrix2 实例(如果未提供)。 The modified result parameter or a new Matrix2 instance if one was not provided.
将此矩阵与提供的矩阵按分量进行比较并返回 Compares this matrix to the provided matrix componentwise and returns
true 如果它们相等, if they are equal, false otherwise.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
right |
Matrix2 | 可选 optional 右侧矩阵。 The right hand side matrix. |
返回: Returns:
true 如果它们相等, if they are equal, false otherwise.
将此矩阵与提供的矩阵按分量进行比较并返回 Compares this matrix to the provided matrix componentwise and returns
true 如果它们在提供的 epsilon 范围内, if they are within the provided epsilon,
false otherwise.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
right |
Matrix2 | 可选 optional 右侧矩阵。 The right hand side matrix. | |
epsilon |
number |
0
|
可选 optional 用于相等性测试的 epsilon。 The epsilon to use for equality testing. |
返回: Returns:
true 如果它们在提供的 epsilon 范围内, if they are within the provided epsilon, false otherwise.
创建一个表示此矩阵的字符串,每行位于单独的行上,格式为“(column0, column1)”。 Creates a string representing this Matrix with each row being on a separate line and in the format '(column0, column1)'.
返回: Returns:
表示提供的矩阵的字符串,每行位于单独的行上,格式为“(column0, column1)”。 A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
static Cesium.Matrix2.abs(matrix, result) → Matrix2
计算一个矩阵,其中包含所提供矩阵元素的绝对(无符号)值。 Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 具有符号元素的矩阵。 The matrix with signed elements. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
static Cesium.Matrix2.add(left, right, result) → Matrix2
计算两个矩阵的和。 Computes the sum of two matrices.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
left |
Matrix2 | 第一个矩阵。 The first matrix. |
right |
Matrix2 | 第二个矩阵。 The second matrix. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
static Cesium.Matrix2.clone(matrix, result) → Matrix2
Duplicates a Matrix2 instance.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要复制的矩阵。 The matrix to duplicate. |
result |
Matrix2 | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的 Matrix2 实例(如果未提供)。 (如果矩阵未定义,则返回未定义) The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
按组件比较提供的矩阵并返回 Compares the provided matrices componentwise and returns
true 如果它们相等, if they are equal, false otherwise.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
left |
Matrix2 | 可选 optional 第一个矩阵。 The first matrix. |
right |
Matrix2 | 可选 optional 第二个矩阵。 The second matrix. |
返回: Returns:
true 如果左和右相等, if left and right are equal, false otherwise.
按组件比较提供的矩阵并返回 Compares the provided matrices componentwise and returns
true 如果它们在提供的 epsilon 范围内, if they are within the provided epsilon,
false otherwise.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
left |
Matrix2 | 可选 optional 第一个矩阵。 The first matrix. | |
right |
Matrix2 | 可选 optional 第二个矩阵。 The second matrix. | |
epsilon |
number |
0
|
可选 optional 用于相等性测试的 epsilon。 The epsilon to use for equality testing. |
返回: Returns:
true 如果 left 和 right 在提供的 epsilon 范围内, if left and right are within the provided epsilon, false otherwise.
static Cesium.Matrix2.fromArray(array, startingIndex, result) → Matrix2
从数组中的 4 个连续元素创建 Matrix2。 Creates a Matrix2 from 4 consecutive elements in an array.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
array |
Array.<number> | 该数组的 4 个连续元素对应于矩阵的位置。假定列优先顺序。 The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order. | |
startingIndex |
number |
0
|
可选 optional 第一个元素在数组中的偏移量,对应于矩阵中第一列第一行的位置。 The offset into the array of the first element, which corresponds to first column first row position in the matrix. |
result |
Matrix2 | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的 Matrix2 实例(如果未提供)。 The modified result parameter or a new Matrix2 instance if one was not provided.
示例: Example:
// Create the Matrix2:
// [1.0, 2.0]
// [1.0, 2.0]
const v = [1.0, 1.0, 2.0, 2.0];
const m = Cesium.Matrix2.fromArray(v);
// Create same Matrix2 with using an offset into an array
const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
const m2 = Cesium.Matrix2.fromArray(v2, 2);
static Cesium.Matrix2.fromColumnMajorArray(values, result) → Matrix2
从列主序数组创建 Matrix2 实例。 Creates a Matrix2 instance from a column-major order array.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
values |
Array.<number> | 列主序数组。 The column-major order array. |
result |
Matrix2 | 可选 optional 将存储结果的对象,如果未定义,将创建一个新实例。 The object in which the result will be stored, if undefined a new instance will be created. |
返回: Returns:
修改后的结果参数,或新的 Matrix2 实例(如果未提供)。 The modified result parameter, or a new Matrix2 instance if one was not provided.
static Cesium.Matrix2.fromRotation(angle, result) → Matrix2
创建旋转矩阵。 Creates a rotation matrix.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
angle |
number | 旋转的角度(以弧度为单位)。正角是逆时针方向。 The angle, in radians, of the rotation. Positive angles are counterclockwise. |
result |
Matrix2 | 可选 optional 将存储结果的对象,如果未定义,将创建一个新实例。 The object in which the result will be stored, if undefined a new instance will be created. |
返回: Returns:
修改后的结果参数,或新的 Matrix2 实例(如果未提供)。 The modified result parameter, or a new Matrix2 instance if one was not provided.
示例: Example:
// Rotate a point 45 degrees counterclockwise.
const p = new Cesium.Cartesian2(5, 6);
const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
static Cesium.Matrix2.fromRowMajorArray(values, result) → Matrix2
从行主序数组创建 Matrix2 实例。生成的矩阵将按列优先顺序排列。 Creates a Matrix2 instance from a row-major order array. The resulting matrix will be in column-major order.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
values |
Array.<number> | 行主序数组。 The row-major order array. |
result |
Matrix2 | 可选 optional 将存储结果的对象,如果未定义,将创建一个新实例。 The object in which the result will be stored, if undefined a new instance will be created. |
返回: Returns:
修改后的结果参数,或新的 Matrix2 实例(如果未提供)。 The modified result parameter, or a new Matrix2 instance if one was not provided.
static Cesium.Matrix2.fromScale(scale, result) → Matrix2
计算表示非均匀比例的 Matrix2 实例。 Computes a Matrix2 instance representing a non-uniform scale.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
scale |
Cartesian2 | x 和 y 比例因子。 The x and y scale factors. |
result |
Matrix2 | 可选 optional 将存储结果的对象,如果未定义,将创建一个新实例。 The object in which the result will be stored, if undefined a new instance will be created. |
返回: Returns:
修改后的结果参数,或新的 Matrix2 实例(如果未提供)。 The modified result parameter, or a new Matrix2 instance if one was not provided.
示例: Example:
// Creates
// [7.0, 0.0]
// [0.0, 8.0]
const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
static Cesium.Matrix2.fromUniformScale(scale, result) → Matrix2
计算表示统一比例的 Matrix2 实例。 Computes a Matrix2 instance representing a uniform scale.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
scale |
number | 统一比例因子。 The uniform scale factor. |
result |
Matrix2 | 可选 optional 将存储结果的对象,如果未定义,将创建一个新实例。 The object in which the result will be stored, if undefined a new instance will be created. |
返回: Returns:
修改后的结果参数,或新的 Matrix2 实例(如果未提供)。 The modified result parameter, or a new Matrix2 instance if one was not provided.
示例: Example:
// Creates
// [2.0, 0.0]
// [0.0, 2.0]
const m = Cesium.Matrix2.fromUniformScale(2.0);
static Cesium.Matrix2.getColumn(matrix, index, result) → Cartesian2
在提供的索引处检索矩阵列的副本作为 Cartesian2 实例。 Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要使用的矩阵。 The matrix to use. |
index |
number | 要检索的列的从零开始的索引。 The zero-based index of the column to retrieve. |
result |
Cartesian2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
抛出: Throws:
-
DeveloperError :索引必须为 0 或 1。 : index must be 0 or 1.
计算所提供的行和列处的元素的数组索引。 Computes the array index of the element at the provided row and column.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
row |
number | 行的从零开始的索引。 The zero-based index of the row. |
column |
number | 列的从零开始的索引。 The zero-based index of the column. |
返回: Returns:
所提供的行和列处的元素的索引。 The index of the element at the provided row and column.
抛出: Throws:
-
DeveloperError : 行必须是 0 或 1。 : row must be 0 or 1.
-
DeveloperError : column must be 0 or 1.
示例: Example:
const myMatrix = new Cesium.Matrix2();
const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
const column1Row0 = myMatrix[column1Row0Index]
myMatrix[column1Row0Index] = 10.0;
假设矩阵是仿射变换,则计算最大尺度。最大比例是列向量的最大长度。 Computes the maximum scale assuming the matrix is an affine transformation. The maximum scale is the maximum length of the column vectors.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 矩阵。 The matrix. |
返回: Returns:
最大规模。 The maximum scale.
static Cesium.Matrix2.getRotation(matrix, result) → Matrix2
假设矩阵是仿射变换,则提取旋转矩阵。 Extracts the rotation matrix assuming the matrix is an affine transformation.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 矩阵。 The matrix. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
另见: See:
static Cesium.Matrix2.getRow(matrix, index, result) → Cartesian2
以 Cartesian2 实例的形式检索提供索引处的矩阵行的副本。 Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要使用的矩阵。 The matrix to use. |
index |
number | 要检索的行的从零开始的索引。 The zero-based index of the row to retrieve. |
result |
Cartesian2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
抛出: Throws:
-
DeveloperError :索引必须为 0 或 1。 : index must be 0 or 1.
static Cesium.Matrix2.getScale(matrix, result) → Cartesian2
假设矩阵是仿射变换,则提取非均匀尺度。 Extracts the non-uniform scale assuming the matrix is an affine transformation.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 矩阵。 The matrix. |
result |
Cartesian2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
另见: See:
static Cesium.Matrix2.multiply(left, right, result) → Matrix2
计算两个矩阵的乘积。 Computes the product of two matrices.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
left |
Matrix2 | 第一个矩阵。 The first matrix. |
right |
Matrix2 | 第二个矩阵。 The second matrix. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
static Cesium.Matrix2.multiplyByScalar(matrix, scalar, result) → Matrix2
计算矩阵和标量的乘积。 Computes the product of a matrix and a scalar.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 矩阵。 The matrix. |
scalar |
number | 要乘以的数字。 The number to multiply by. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
static Cesium.Matrix2.multiplyByScale(matrix, scale, result) → Matrix2
计算矩阵乘以(非均匀)比例的乘积,就好像比例是比例矩阵一样。 Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 左侧的矩阵。 The matrix on the left-hand side. |
scale |
Cartesian2 | 右侧的比例不均匀。 The non-uniform scale on the right-hand side. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
示例: Example:
// Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
Cesium.Matrix2.multiplyByScale(m, scale, m);
另见: See:
static Cesium.Matrix2.multiplyByUniformScale(matrix, scale, result) → Matrix2
计算矩阵乘以统一比例的乘积,就好像比例是比例矩阵一样。 Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 左侧的矩阵。 The matrix on the left-hand side. |
scale |
number | 右侧的统一比例。 The uniform scale on the right-hand side. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
示例: Example:
// Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);
Cesium.Matrix2.multiplyByUniformScale(m, scale, m);
另见: See:
static Cesium.Matrix2.multiplyByVector(matrix, cartesian, result) → Cartesian2
计算矩阵和列向量的乘积。 Computes the product of a matrix and a column vector.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 矩阵。 The matrix. |
cartesian |
Cartesian2 | 专栏。 The column. |
result |
Cartesian2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
static Cesium.Matrix2.negate(matrix, result) → Matrix2
创建所提供矩阵的否定副本。 Creates a negated copy of the provided matrix.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要求反的矩阵。 The matrix to negate. |
result |
Matrix2 | 用于存储结果的对象。 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 |
|---|---|---|---|
value |
Matrix2 | 包装的价值。 The value to pack. | |
array |
Array.<number> | 要打包到的数组。 The array to pack into. | |
startingIndex |
number |
0
|
可选 optional 开始打包元素的数组索引。 The index into the array at which to start packing the elements. |
返回: Returns:
被打包成的数组 The array that was packed into
将 Matrix2 数组展平为组件数组。组件按列优先顺序存储。 Flattens an array of Matrix2s into an array of components. The components are stored in column-major order.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
array |
Array.<Matrix2> | 要打包的矩阵数组。 The array of matrices to pack. |
result |
Array.<number> |
可选 optional
用于存储结果的数组。如果这是一个类型化数组,它必须有 array.length * 4 个组件,否则 The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a DeveloperError 将被抛出。如果它是常规数组,它将被调整大小以具有 (array.length * 4) 个元素。 will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements. |
返回: Returns:
打包的数组。 The packed array.
static Cesium.Matrix2.setColumn(matrix, index, cartesian, result) → Matrix2
计算一个新矩阵,用提供的 Cartesian2 实例替换提供的矩阵中的指定列。 Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要使用的矩阵。 The matrix to use. |
index |
number | 要设置的列的从零开始的索引。 The zero-based index of the column to set. |
cartesian |
Cartesian2 | 其值将分配给指定列的笛卡尔坐标。 The Cartesian whose values will be assigned to the specified column. |
result |
Cartesian2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
抛出: Throws:
-
DeveloperError :索引必须为 0 或 1。 : index must be 0 or 1.
static Cesium.Matrix2.setRotation(matrix, rotation, result) → Matrix2
假设矩阵是仿射变换,则设置旋转。 Sets the rotation assuming the matrix is an affine transformation.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 矩阵。 The matrix. |
rotation |
Matrix2 | 旋转矩阵。 The rotation matrix. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
另见: See:
static Cesium.Matrix2.setRow(matrix, index, cartesian, result) → Matrix2
计算一个新矩阵,用提供的 Cartesian2 实例替换提供的矩阵中的指定行。 Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要使用的矩阵。 The matrix to use. |
index |
number | 要设置的行的从零开始的索引。 The zero-based index of the row to set. |
cartesian |
Cartesian2 | 其值将分配给指定行的笛卡尔坐标。 The Cartesian whose values will be assigned to the specified row. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
抛出: Throws:
-
DeveloperError :索引必须为 0 或 1。 : index must be 0 or 1.
static Cesium.Matrix2.setScale(matrix, scale, result) → Matrix2
计算一个新矩阵,用提供的比例替换比例。这假设矩阵是仿射变换。 Computes a new matrix that replaces the scale with the provided scale. This assumes the matrix is an affine transformation.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要使用的矩阵。 The matrix to use. |
scale |
Cartesian2 | 替换所提供矩阵的比例的比例。 The scale that replaces the scale of the provided matrix. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
另见: See:
static Cesium.Matrix2.setUniformScale(matrix, scale, result) → Matrix2
计算一个新矩阵,用提供的统一比例替换比例。这假设矩阵是仿射变换。 Computes a new matrix that replaces the scale with the provided uniform scale. This assumes the matrix is an affine transformation.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要使用的矩阵。 The matrix to use. |
scale |
number | 替换所提供矩阵的比例的统一比例。 The uniform scale that replaces the scale of the provided matrix. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
另见: See:
static Cesium.Matrix2.subtract(left, right, result) → Matrix2
计算两个矩阵的差。 Computes the difference of two matrices.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
left |
Matrix2 | 第一个矩阵。 The first matrix. |
right |
Matrix2 | 第二个矩阵。 The second matrix. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
从提供的 Matrix2 实例创建一个数组。该数组将按列优先顺序排列。 Creates an Array from the provided Matrix2 instance. The array will be in column-major order.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 使用的矩阵.. The matrix to use.. |
result |
Array.<number> | 可选 optional 用于存储结果的数组。 The Array onto which to store the result. |
返回: Returns:
修改后的 Array 参数或新的 Array 实例(如果未提供)。 The modified Array parameter or a new Array instance if one was not provided.
static Cesium.Matrix2.transpose(matrix, result) → Matrix2
计算所提供矩阵的转置。 Computes the transpose of the provided matrix.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
matrix |
Matrix2 | 要转置的矩阵。 The matrix to transpose. |
result |
Matrix2 | 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
static Cesium.Matrix2.unpack(array, startingIndex, result) → Matrix2
从打包数组中检索实例。 Retrieves an instance from a packed array.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
array |
Array.<number> | 打包的数组。 The packed array. | |
startingIndex |
number |
0
|
可选 optional 要解包的元素的起始索引。 The starting index of the element to be unpacked. |
result |
Matrix2 | 可选 optional 用于存储结果的对象。 The object into which to store the result. |
返回: Returns:
修改后的结果参数或新的 Matrix2 实例(如果未提供)。 The modified result parameter or a new Matrix2 instance if one was not provided.
static Cesium.Matrix2.unpackArray(array, result) → Array.<Matrix2>
将列主矩阵分量数组解压缩为 Matrix2 数组。 Unpacks an array of column-major matrix components into an array of Matrix2s.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
array |
Array.<number> | 要解压的组件数组。 The array of components to unpack. |
result |
Array.<Matrix2> | 可选 optional 用于存储结果的数组。 The array onto which to store the result. |
返回: Returns:
解压后的数组。 The unpacked array.
