* Extracts the non-uniform scale assuming the matrix is an affine transformation. * * @param {Matrix3} matrix The matrix. * @param {Cartesian3} result The object onto which to store the result. * @returns {Cartesian3} The modified result parameter. * * @see Matrix3.multiplyByScale
(matrix, result)
| 942 | * @see Matrix3.setUniformScale |
| 943 | */ |
| 944 | static getScale(matrix, result) { |
| 945 | //>>includeStart('debug', pragmas.debug); |
| 946 | Check.typeOf.object("matrix", matrix); |
| 947 | Check.typeOf.object("result", result); |
| 948 | //>>includeEnd('debug'); |
| 949 | |
| 950 | result.x = Cartesian3.magnitude( |
| 951 | Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn), |
| 952 | ); |
| 953 | result.y = Cartesian3.magnitude( |
| 954 | Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn), |
| 955 | ); |
| 956 | result.z = Cartesian3.magnitude( |
| 957 | Cartesian3.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn), |
| 958 | ); |
| 959 | return result; |
| 960 | } |
| 961 | |
| 962 | /** |
| 963 | * Computes the maximum scale assuming the matrix is an affine transformation. |
no test coverage detected