DOMMatrix:multiplySelf() 方法
注意:此功能在 Web Workers 中可用。
multiplySelf() 方法是 DOMMatrix 介面的一個方法,它將矩陣與 otherMatrix 引數相乘,計算原始矩陣與指定矩陣的點積:A⋅B。如果未指定乘數矩陣,則矩陣會乘以一個矩陣,該矩陣中除了右下角及其左上方和左側緊鄰的元素(m33 和 m34)之外,所有元素均為 0。這些元素具有預設值 1。
要相乘矩陣而不改變它,請參閱 DOMMatrixReadOnly.multiply()。
語法
js
multiplySelf()
multiplySelf(otherMatrix)
引數
返回值
返回自身;根據應用乘法的結果更新的 DOMMatrix。
示例
js
const matrix = new DOMMatrix().rotate(30);
console.log(matrix.toString());
// output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0)
matrix.multiplySelf(matrix);
console.log(matrix.toString());
// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) (a 60deg rotation)
規範
| 規範 |
|---|
| Geometry Interfaces Module Level 1 # dom-dommatrix-multiplyself |
瀏覽器相容性
載入中…
另見
DOMMatrixReadOnly.multiply()DOMMatrix.preMultiplySelf()- CSS
matrix()函式 - CSS
matrix3d()函式