一个 3x3 矩阵,可按列优先顺序数组进行索引。为便于代码阅读,构造函数参数以行优先顺序排列。
| Name | Type | Default | Description |
|---|---|---|---|
column0Row0 |
Number |
0.0
|
optional 第 0 列第 0 行的值。 |
column1Row0 |
Number |
0.0
|
optional 第 1 列第 0 行的值。 |
column2Row0 |
Number |
0.0
|
optional 第 2 列第 0 行的值。 |
column0Row1 |
Number |
0.0
|
optional 第 0 列第 1 行的值。 |
column1Row1 |
Number |
0.0
|
optional 第 1 列第 1 行的值。 |
column2Row1 |
Number |
0.0
|
optional 第 2 列第 1 行的值。 |
column0Row2 |
Number |
0.0
|
optional 第 0 列第 2 行的值。 |
column1Row2 |
Number |
0.0
|
optional 第 1 列第 2 行的值。 |
column2Row2 |
Number |
0.0
|
optional 第 2 列第 2 行的值。 |
Members
-
用于将对象打包到数组中的元素数
-
Matrix3 中第 0 列第 0 行的索引。
-
Matrix3 中第 0 列第 1 行的索引。
-
Matrix3 中第 0 列第 2 行的索引。
-
Matrix3 中第 1 列第 0 行的索引。
-
Matrix3 中第 1 列第 1 行的索引。
-
Matrix3 中第 1 列第 2 行的索引。
-
Matrix3 中第 2 列第 0 行的索引。
-
第 2 列第 1 行的 Matrix3 索引。
-
第 2 列第 2 行的 Matrix3 索引。
-
staticconstantSuperMap3D.Matrix3.IDENTITY : Matrix3
-
初始化为单位矩阵的不可变 Matrix3 实例。
-
用于将对象打包到数组中的元素数。
-
staticconstantSuperMap3D.Matrix3.ZERO : Matrix3
-
一个不可变的 Matrix3 实例,初始化为零矩阵。
Methods
-
clone(result) → Matrix3
-
复制提供的 Matrix3 实例。
Name Type Description resultMatrix3 optional 存储结果的对象。 Returns:
修改后的结果参数或新的 Matrix3 实例(如果未提供)。 -
将此矩阵与提供的矩阵进行比较,如果它们相等则返回 true ,否则返回 false 。
Name Type Description rightMatrix3 optional 右手矩阵。 Returns:
如果它们相等,则为 true ,否则为 false 。 -
将此矩阵与提供的矩阵按分量进行比较,如果它们在提供的 epsilon 内,则返回 true ,否则返回 false 。
Name Type Description rightMatrix3 optional 右手矩阵。 epsilonNumber 用于相等性测试的 epsilon。 Returns:
如果它们在提供的 epsilon 内,则为 true ,否则为 false 。 -
创建一个表示此矩阵的字符串,每行位于单独的行上,格式为'(column0,column1,column2)'。
Returns:
表示提供的矩阵的字符串,每行位于单独的行上,格式为'(column0,column1,column2)'。 -
staticSuperMap3D.Matrix3.abs(matrix, result) → Matrix3
-
计算一个矩阵,其中包含所提供矩阵元素的绝对(无符号)值。
Name Type Description matrixMatrix3 带有符号元素的矩阵。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。 -
staticSuperMap3D.Matrix3.add(left, right, result) → Matrix3
-
计算两个矩阵的和。
Name Type Description leftMatrix3 第一个矩阵。 rightMatrix3 第二个矩阵。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。 -
staticSuperMap3D.Matrix3.clone(matrix, result) → Matrix3
-
复制 Matrix3 实例。
Name Type Description matrixMatrix3 要复制的矩阵。 resultMatrix3 optional 存储结果的对象。 Returns:
修改后的结果参数或新的 Matrix3 实例(如果未提供)。 (如果矩阵未定义,则返回未定义) -
计算对称矩阵的特征向量和特征值。
返回一个对角矩阵和酉矩阵,例如:
matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)沿对角矩阵的对角线的值是特征值。酉矩阵的列是对应的特征向量。
Name Type Description matrixMatrix3 要分解成对角矩阵和单元矩阵的矩阵。预计为对称矩阵。 resultObject optional 一个具有单元和对角属性的对象,是用来存储结果的矩阵。 Returns:
具有单元和对角属性的对象,分别是单元矩阵和对角矩阵。Example:
var a = //... symetric matrix var result = { unitary : new SuperMap3D.Matrix3(), diagonal : new SuperMap3D.Matrix3() }; SuperMap3D.Matrix3.computeEigenDecomposition(a, result); var unitaryTranspose = SuperMap3D.Matrix3.transpose(result.unitary, new SuperMap3D.Matrix3()); var b = SuperMap3D.Matrix3.multiply(result.unitary, result.diagonal, new SuperMap3D.Matrix3()); SuperMap3D.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a var lambda = SuperMap3D.Matrix3.getColumn(result.diagonal, 0, new SuperMap3D.Cartesian3()).x; // first eigenvalue var v = SuperMap3D.Matrix3.getColumn(result.unitary, 0, new SuperMap3D.Cartesian3()); // first eigenvector var c = SuperMap3D.Cartesian3.multiplyByScalar(v, lambda, new SuperMap3D.Cartesian3()); // equal to SuperMap3D.Matrix3.multiplyByVector(a, v) -
计算提供的矩阵的行列式。
Name Type Description matrixMatrix3 要使用的矩阵。 Returns:
矩阵行列式的值。 -
逐个比较提供的矩阵,如果它们相等则返回 true ,否则返回 false 。
Name Type Description leftMatrix3 optional 第一个矩阵。 rightMatrix3 optional 第二个矩阵。 Returns:
如果相等,则为 true ,否则为 false 。 -
逐个比较提供的矩阵,如果它们在提供的 epsilon 内,则返回 true ,否则返回 false 。
Name Type Description leftMatrix3 optional 第一个矩阵。 rightMatrix3 optional 第二个矩阵。 epsilonNumber 用于相等性测试的 epsilon。 Returns:
如果它们在提供的 epsilon 内,则为 true,否则为 false 。 -
staticSuperMap3D.Matrix3.fromArray(array, startingIndex, result) → Matrix3
-
从数组中的 9 个连续元素创建一个 Matrix3。
Name Type Default Description arrayArray.<Number> 其 9 个连续元素对应于矩阵的位置的数组。假定列优先顺序。 startingIndexNumber 0optional 第一个元素在数组中的偏移量,对应于矩阵中第一列第一行的位置。 resultMatrix3 optional 存储结果的对象。 Returns:
修改后的结果参数或新的 Matrix3 实例(如果未提供)。Example:
// Create the Matrix3: // [1.0, 2.0, 3.0] // [1.0, 2.0, 3.0] // [1.0, 2.0, 3.0] var v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; var m = SuperMap3D.Matrix3.fromArray(v); // Create same Matrix3 with using an offset into an array var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; var m2 = SuperMap3D.Matrix3.fromArray(v2, 2); -
staticSuperMap3D.Matrix3.fromColumnMajorArray(values, result) → Matrix3
-
从列主顺序数组创建一个 Matrix3 实例。
Name Type Description valuesArray.<Number> 列主要顺序数组。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。 -
staticSuperMap3D.Matrix3.fromCrossProduct(vector, result) → Matrix3
-
计算一个表示 Cartesian3 向量的叉积等效矩阵的 Matrix3 实例。
Name Type Description vectorCartesian3 叉积运算左侧的向量。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。Example:
// Creates // [0.0, -9.0, 8.0] // [9.0, 0.0, -7.0] // [-8.0, 7.0, 0.0] var m = SuperMap3D.Matrix3.fromCrossProduct(new SuperMap3D.Cartesian3(7.0, 8.0, 9.0)); -
staticSuperMap3D.Matrix3.fromHeadingPitchRoll(headingPitchRoll, result) → Matrix3
-
从提供的 headingPitchRoll 计算 3x3 旋转矩阵。(参见 http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
Name Type Description headingPitchRollHeadingPitchRoll 要使用的方位俯仰旋转。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
该方位俯仰旋转的 3x3 旋转矩阵。 -
staticSuperMap3D.Matrix3.fromQuaternion(quaternion, result) → Matrix3
-
根据提供的四元数计算 3x3 旋转矩阵。
Name Type Description quaternionQuaternion 要使用的四元数。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
这个四元数的 3x3 旋转矩阵。 -
staticSuperMap3D.Matrix3.fromRotationX(angle, result) → Matrix3
-
创建一个围绕 x 轴的旋转矩阵。
Name Type Description angleNumber 旋转的角度,以弧度为单位。正角是逆时针的。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。Example:
// Rotate a point 45 degrees counterclockwise around the x-axis. var p = new SuperMap3D.Cartesian3(5, 6, 7); var m = SuperMap3D.Matrix3.fromRotationX(SuperMap3D.Math.toRadians(45.0)); var rotated = SuperMap3D.Matrix3.multiplyByVector(m, p, new SuperMap3D.Cartesian3()); -
staticSuperMap3D.Matrix3.fromRotationY(angle, result) → Matrix3
-
创建一个围绕 y 轴的旋转矩阵。
Name Type Description angleNumber 旋转的角度,以弧度为单位。正角是逆时针的。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。Example:
// Rotate a point 45 degrees counterclockwise around the y-axis. var p = new SuperMap3D.Cartesian3(5, 6, 7); var m = SuperMap3D.Matrix3.fromRotationY(SuperMap3D.Math.toRadians(45.0)); var rotated = SuperMap3D.Matrix3.multiplyByVector(m, p, new SuperMap3D.Cartesian3()); -
staticSuperMap3D.Matrix3.fromRotationZ(angle, result) → Matrix3
-
围绕 z 轴创建一个旋转矩阵。
Name Type Description angleNumber 旋转的角度,以弧度为单位。正角是逆时针的。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。Example:
// Rotate a point 45 degrees counterclockwise around the z-axis. var p = new SuperMap3D.Cartesian3(5, 6, 7); var m = SuperMap3D.Matrix3.fromRotationZ(SuperMap3D.Math.toRadians(45.0)); var rotated = SuperMap3D.Matrix3.multiplyByVector(m, p, new SuperMap3D.Cartesian3()); -
staticSuperMap3D.Matrix3.fromRowMajorArray(values, result) → Matrix3
-
从行主要顺序数组创建一个 Matrix3 实例。生成的矩阵将按列优先顺序排列。
Name Type Description valuesArray.<Number> 行主要顺序数组。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。 -
staticSuperMap3D.Matrix3.fromScale(scale, result) → Matrix3
-
计算一个表示非均匀比例的 Matrix3 实例。
Name Type Description scaleCartesian3 x、y 和 z 比例因子。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。Example:
// Creates // [7.0, 0.0, 0.0] // [0.0, 8.0, 0.0] // [0.0, 0.0, 9.0] var m = SuperMap3D.Matrix3.fromScale(new SuperMap3D.Cartesian3(7.0, 8.0, 9.0)); -
staticSuperMap3D.Matrix3.fromUniformScale(scale, result) → Matrix3
-
计算一个表示统一比例的 Matrix3 实例。
Name Type Description scaleNumber 统一比例因子。 resultMatrix3 optional 存储结果的对象,如果未定义,将创建一个新实例。 Returns:
修改后的结果参数,如果未提供,则为新的 Matrix3 实例。Example:
// Creates // [2.0, 0.0, 0.0] // [0.0, 2.0, 0.0] // [0.0, 0.0, 2.0] var m = SuperMap3D.Matrix3.fromUniformScale(2.0); -
staticSuperMap3D.Matrix3.getColumn(matrix, index, result) → Cartesian3
-
以 Cartesian3 实例的形式读取所提供索引处矩阵列的副本。
Name Type Description matrixMatrix3 使用的矩阵。 indexNumber 要检索的列的零基索引。 resultCartesian3 存储结果的对象。 Returns:
修改后的结果参数。Throws:
-
DeveloperError : 索引必须为 0、1 或 2。
-
-
计算提供的行和列的元素的数组索引。
Name Type Description rowNumber 该行的零基索引。 columnNumber 列的零基索引。 Returns:
所提供行和列上元素的索引。Throws:
-
DeveloperError : 行必须为 0、1 或 2。
-
DeveloperError : 列必须为 0、1 或 2。
Example:
var myMatrix = new SuperMap3D.Matrix3(); var column1Row0Index = SuperMap3D.Matrix3.getElementIndex(1, 0); var column1Row0 = myMatrix[column1Row0Index] myMatrix[column1Row0Index] = 10.0; -
-
假设矩阵是仿射变换,计算最大比例。最大比例是列向量的最大长度。
Name Type Description matrixMatrix3 矩阵。 Returns:
最大比例。 -
staticSuperMap3D.Matrix3.getRow(matrix, index, result) → Cartesian3
-
以 Cartesian3 实例的形式读取所提供索引处矩阵行的副本。
Name Type Description matrixMatrix3 使用的矩阵。 indexNumber 要检索的记录的零基索引。 resultCartesian3 存储结果的对象。 Returns:
修改后的结果参数。Throws:
-
DeveloperError : 索引必须为 0、1 或 2。
-
-
staticSuperMap3D.Matrix3.getScale(matrix, result) → Cartesian3
-
假设矩阵是仿射变换,提取非均匀比例。
Name Type Description matrixMatrix3 矩阵。 resultCartesian3 存储结果的对象。 Returns:
修改后的结果参数。 -
staticSuperMap3D.Matrix3.inverse(matrix, result) → Matrix3
-
计算提供的矩阵的逆矩阵。
Name Type Description matrixMatrix3 要反转的矩阵。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。Throws:
-
DeveloperError : 矩阵不可逆。
-
-
staticSuperMap3D.Matrix3.multiply(left, right, result) → Matrix3
-
计算两个矩阵的乘积。
Name Type Description leftMatrix3 第一个矩阵。 rightMatrix3 第二个矩阵。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。 -
staticSuperMap3D.Matrix3.multiplyByScalar(matrix, scalar, result) → Matrix3
-
计算矩阵和标量的乘积。
Name Type Description matrixMatrix3 矩阵。 scalarNumber 要乘以的数值。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。 -
staticSuperMap3D.Matrix3.multiplyByScale(matrix, scale, result) → Matrix3
-
计算矩阵乘以(非均匀)比例的乘积。
Name Type Description matrixMatrix3 左手矩阵。 scaleCartesian3 右手非均匀比例。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。- Matrix3.fromScale
- Matrix3.multiplyByUniformScale
Example:
// Instead of SuperMap3D.Matrix3.multiply(m, SuperMap3D.Matrix3.fromScale(scale), m); SuperMap3D.Matrix3.multiplyByScale(m, scale, m);See:
-
staticSuperMap3D.Matrix3.multiplyByVector(matrix, cartesian, result) → Cartesian3
-
计算矩阵和列向量的乘积。
Name Type Description matrixMatrix3 矩阵。 cartesianCartesian3 专栏。 resultCartesian3 存储结果的对象。 Returns:
修改后的结果参数。 -
staticSuperMap3D.Matrix3.negate(matrix, result) → Matrix3
-
创建所提供矩阵的否定副本。
Name Type Description matrixMatrix3 要否定的矩阵。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。 -
将提供的实例存储到提供的数组中。
Name Type Default Description valueMatrix3 要打包的值。 arrayArray.<Number> 要打包的数组。 startingIndexNumber 0optional 开始打包元素的数组索引。 Returns:
装入的数组。 -
staticSuperMap3D.Matrix3.setColumn(matrix, index, cartesian, result) → Matrix3
-
计算一个新矩阵,用所提供的 Cartesian3 实例替换所提供矩阵中的指定列。
Name Type Description matrixMatrix3 使用的矩阵。 indexNumber 要设置的列的零基索引。 cartesianCartesian3 Cartesian其值将分配给指定列。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。Throws:
-
DeveloperError : 索引必须为 0、1 或 2。
-
-
staticSuperMap3D.Matrix3.setRow(matrix, index, cartesian, result) → Matrix3
-
Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
Name Type Description matrixMatrix3 使用的矩阵。 indexNumber 要设置的行的零基索引。 cartesianCartesian3 The Cartesian whose values will be assigned to the specified row. resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。Throws:
-
DeveloperError : 索引必须为 0、1 或 2。
-
-
staticSuperMap3D.Matrix3.subtract(left, right, result) → Matrix3
-
计算两个矩阵的差。
Name Type Description leftMatrix3 第一个矩阵。 rightMatrix3 第二个矩阵。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。 -
从提供的 Matrix3 实例创建一个 Array。该数组将按列优先顺序排列。
Name Type Description matrixMatrix3 要使用的矩阵。 resultArray.<Number> optional 存储结果的数组。 Returns:
修改后的 Array 参数或新的 Array 实例(如果未提供)。 -
staticSuperMap3D.Matrix3.transpose(matrix, result) → Matrix3
-
计算提供的矩阵的转置。
Name Type Description matrixMatrix3 要转置的矩阵。 resultMatrix3 存储结果的对象。 Returns:
修改后的结果参数。 -
staticSuperMap3D.Matrix3.unpack(array, startingIndex, result) → Matrix3
-
从打包数组中检索实例。
Name Type Default Description arrayArray.<Number> 打包的数组。 startingIndexNumber 0optional 要解包的元素的起始索引。 resultMatrix3 optional 存储结果的对象。 Returns:
修改后的结果参数或新的 Matrix3 实例(如果未提供)。
