From 985d71ac8406de927e9e1aa9b65f9f0a6000217a Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 11 Dec 2024 10:42:54 -0800 Subject: [PATCH 01/12] New files: DOMMatrix.multiply() --- .../web/api/dommatrix/multiplyself/index.md | 58 +++++++++++++++++++ .../en-us/web/api/dommatrixreadonly/index.md | 2 +- .../api/dommatrixreadonly/multiply/index.md | 56 ++++++++++++++++++ 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 files/en-us/web/api/dommatrix/multiplyself/index.md create mode 100644 files/en-us/web/api/dommatrixreadonly/multiply/index.md diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md new file mode 100644 index 000000000000000..29163f01c59c3c3 --- /dev/null +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -0,0 +1,58 @@ +--- +title: "DOMMatrix: multiply() method" +short-title: multiply() +slug: Web/API/DOMMatrix/multiply +page-type: web-api-instance-method +browser-compat: api.DOMMatrix.multiply +--- + +{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} + +The **`multiply()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the matrix parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. + +To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multiply()")}} + +## Syntax + +```js-nolint + DOMMatrix.multiply( ) + DOMMatrix.multiply( otherMatrix ) +``` + +### Parameters + +- `otherMatrix` + - : The [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) multiplier. + +### Return value + +Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the results of the applied multiplications. + +## Examples + +```js +const matrix = new DOMMatrix().rotate(30); + +console.log(matrix.toString()); +// output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0) + +matrix.multiply(matrix); + +console.log(matrix.toString()); +// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("DOMMatrixReadOnly.multiply()")}} +- {{domxref("DOMMatrixReadOnly.preMultiply()")}} +- CSS {{CSSxRef("transform-function/matrix", "matrix()")}} function +- CSS {{CSSxRef("transform-function/matrix3d", "matrix3d()")}} function diff --git a/files/en-us/web/api/dommatrixreadonly/index.md b/files/en-us/web/api/dommatrixreadonly/index.md index 0940b043bd7e4ca..8094dd12bedd4a2 100644 --- a/files/en-us/web/api/dommatrixreadonly/index.md +++ b/files/en-us/web/api/dommatrixreadonly/index.md @@ -50,7 +50,7 @@ _This interface doesn't inherit any methods. None of the following methods alter - {{domxref("DOMMatrixReadOnly.inverse()")}} - : Returns a new {{domxref("DOMMatrix")}} created by inverting the source matrix. If the matrix cannot be inverted, the new matrix's components are all set to `NaN` and its `is2D` property is set to `false`. The original matrix is not altered. - {{domxref("DOMMatrixReadOnly.multiply()")}} - - : Returns a new {{domxref("DOMMatrix")}} created by computing the dot product of the source matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. The original matrix is not modified. + - : Returns a new {{domxref("DOMMatrix")}} created by computing the dot product of the source matrix and the specified matrix. The original matrix is not - {{domxref("DOMMatrixReadOnly.rotateAxisAngle()")}} - : Returns a new {{domxref("DOMMatrix")}} created by rotating the source matrix by the given angle around the specified vector. The original matrix is not modified. - {{domxref("DOMMatrixReadOnly.rotate()")}} diff --git a/files/en-us/web/api/dommatrixreadonly/multiply/index.md b/files/en-us/web/api/dommatrixreadonly/multiply/index.md new file mode 100644 index 000000000000000..c3564bb5f542f23 --- /dev/null +++ b/files/en-us/web/api/dommatrixreadonly/multiply/index.md @@ -0,0 +1,56 @@ +--- +title: "DOMMatrixReadOnly: multiply() method" +short-title: multiply() +slug: Web/API/DOMMatrixReadOnly/multiply +page-type: web-api-instance-method +browser-compat: api.DOMMatrixReadOnly.multiply +--- + +{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} + +The **`multiply()`** method of the {{domxref("DOMMatrixReadOnly")}} interface creates a new matrix being the result of the multiplication of the original matrix. The method returns a new {{domxref("DOMMatrix")}} created by computing the dot product of the source matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. The original matrix is not modified. + +To mutate the matrix as you multiply it, see {{domxref("DOMMatrix.multiplySelf()")}} + +## Syntax + +```js-nolint + DOMMatrixReadOnly.multiply( ) + DOMMatrixReadOnly.multiply( otherMatrix ) +``` + +### Parameters + +- `otherMatrix` + - : The [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) multiplier. + +### Return value + +Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the results of the applied multiplications. + +## Examples + +```js +const matrix = new DOMMatrixReadOnly().rotate(30); +const multipliedMatrix = matrix.multiply(matrix); + +console.log(matrix.toString()); +// output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0) +console.log(multipliedMatrix.toString()); +// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("DOMMatrix.multiplySelf()")}} +- {{domxref("DOMMatrixReadOnly.preMultiply()")}} +- CSS {{CSSxRef("transform-function/matrix", "matrix()")}} function +- CSS {{CSSxRef("transform-function/matrix3d", "matrix3d()")}} function From 40169d09aeadc483247dedc93c9ac6d65596c775 Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 11 Dec 2024 10:52:23 -0800 Subject: [PATCH 02/12] typo --- files/en-us/web/api/dommatrix/multiplyself/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index 29163f01c59c3c3..ca721c641c0b991 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -53,6 +53,6 @@ console.log(matrix.toString()); ## See also - {{domxref("DOMMatrixReadOnly.multiply()")}} -- {{domxref("DOMMatrixReadOnly.preMultiply()")}} +- {{domxref("DOMMatrix.preMultiply()")}} - CSS {{CSSxRef("transform-function/matrix", "matrix()")}} function - CSS {{CSSxRef("transform-function/matrix3d", "matrix3d()")}} function From 095baed5c066c6870a50a30692b9c961151ff4d5 Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 11 Dec 2024 10:53:48 -0800 Subject: [PATCH 03/12] typo --- files/en-us/web/api/dommatrix/multiplyself/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index ca721c641c0b991..da3793f73ec794b 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -53,6 +53,6 @@ console.log(matrix.toString()); ## See also - {{domxref("DOMMatrixReadOnly.multiply()")}} -- {{domxref("DOMMatrix.preMultiply()")}} +- {{domxref("DOMMatrix.preMultiplySelf()")}} - CSS {{CSSxRef("transform-function/matrix", "matrix()")}} function - CSS {{CSSxRef("transform-function/matrix3d", "matrix3d()")}} function From 05c682c3763d3d07a09eeab9304e0096f8e8642b Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 11 Dec 2024 10:56:56 -0800 Subject: [PATCH 04/12] forgot to save --- .../web/api/dommatrix/multiplyself/index.md | 16 ++--- .../api/dommatrix/premultiplyself/index.md | 58 +++++++++++++++++++ 2 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 files/en-us/web/api/dommatrix/premultiplyself/index.md diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index da3793f73ec794b..c143a64a371efae 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -1,22 +1,22 @@ --- -title: "DOMMatrix: multiply() method" -short-title: multiply() -slug: Web/API/DOMMatrix/multiply +title: "DOMMatrix: multiplySelf() method" +short-title: multiplySelf() +slug: Web/API/DOMMatrix/multiplySelf page-type: web-api-instance-method -browser-compat: api.DOMMatrix.multiply +browser-compat: api.DOMMatrix.multiplySelf --- {{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} -The **`multiply()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the matrix parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. +The **`multiplySelf()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the matrix parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multiply()")}} ## Syntax ```js-nolint - DOMMatrix.multiply( ) - DOMMatrix.multiply( otherMatrix ) + DOMMatrix.multiplySelf( ) + DOMMatrix.multiplySelf( otherMatrix ) ``` ### Parameters @@ -36,7 +36,7 @@ const matrix = new DOMMatrix().rotate(30); console.log(matrix.toString()); // output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0) -matrix.multiply(matrix); +matrix.multiplySelf(matrix); console.log(matrix.toString()); // output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) diff --git a/files/en-us/web/api/dommatrix/premultiplyself/index.md b/files/en-us/web/api/dommatrix/premultiplyself/index.md new file mode 100644 index 000000000000000..da3793f73ec794b --- /dev/null +++ b/files/en-us/web/api/dommatrix/premultiplyself/index.md @@ -0,0 +1,58 @@ +--- +title: "DOMMatrix: multiply() method" +short-title: multiply() +slug: Web/API/DOMMatrix/multiply +page-type: web-api-instance-method +browser-compat: api.DOMMatrix.multiply +--- + +{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} + +The **`multiply()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the matrix parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. + +To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multiply()")}} + +## Syntax + +```js-nolint + DOMMatrix.multiply( ) + DOMMatrix.multiply( otherMatrix ) +``` + +### Parameters + +- `otherMatrix` + - : The [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) multiplier. + +### Return value + +Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the results of the applied multiplications. + +## Examples + +```js +const matrix = new DOMMatrix().rotate(30); + +console.log(matrix.toString()); +// output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0) + +matrix.multiply(matrix); + +console.log(matrix.toString()); +// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("DOMMatrixReadOnly.multiply()")}} +- {{domxref("DOMMatrix.preMultiplySelf()")}} +- CSS {{CSSxRef("transform-function/matrix", "matrix()")}} function +- CSS {{CSSxRef("transform-function/matrix3d", "matrix3d()")}} function From f597b0e9fbc7c4cb949533e17d1ca41feac36f1e Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 11 Dec 2024 11:17:42 -0800 Subject: [PATCH 05/12] new page: premultiplyself() --- files/en-us/web/api/dommatrix/index.md | 2 +- .../api/dommatrix/premultiplyself/index.md | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/files/en-us/web/api/dommatrix/index.md b/files/en-us/web/api/dommatrix/index.md index 1a3f6433d6d6988..23a47ef84027fc1 100644 --- a/files/en-us/web/api/dommatrix/index.md +++ b/files/en-us/web/api/dommatrix/index.md @@ -52,7 +52,7 @@ _This interface includes the following methods, as well as the methods it inheri - {{domxref("DOMMatrix.multiplySelf()")}} - : Modifies the matrix by post-multiplying it with the specified `DOMMatrix`. This is equivalent to the dot product `A⋅B`, where matrix `A` is the source matrix and `B` is the matrix given as an input to the method. Returns itself. - {{domxref("DOMMatrix.preMultiplySelf()")}} - - : Modifies the matrix by pre-multiplying it with the specified `DOMMatrix`. This is equivalent to the dot product `B⋅A`, where matrix `A` is the source matrix and `B` is the matrix given as an input to the method. Returns itself. + - : Modifies the matrix by pre-multiplying it with the specified `DOMMatrix`. Returns itself. - {{domxref("DOMMatrix.translateSelf()")}} - : Modifies the matrix by applying the specified vector. The default vector is `[0, 0, 0]`. Returns itself. - {{domxref("DOMMatrix.scaleSelf()")}} diff --git a/files/en-us/web/api/dommatrix/premultiplyself/index.md b/files/en-us/web/api/dommatrix/premultiplyself/index.md index da3793f73ec794b..4473bfc31b4c58f 100644 --- a/files/en-us/web/api/dommatrix/premultiplyself/index.md +++ b/files/en-us/web/api/dommatrix/premultiplyself/index.md @@ -1,22 +1,20 @@ --- -title: "DOMMatrix: multiply() method" -short-title: multiply() -slug: Web/API/DOMMatrix/multiply +title: "DOMMatrix: preMultiplySelf() method" +short-title: preMultiplySelf() +slug: Web/API/DOMMatrix/preMultiplySelf page-type: web-api-instance-method -browser-compat: api.DOMMatrix.multiply +browser-compat: api.DOMMatrix.preMultiplySelf --- {{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} -The **`multiply()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the matrix parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. - -To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multiply()")}} +The **`preMultiplySelf()`** method of the {{domxref("DOMMatrix")}} interface Modifies the matrix by pre-multiplying it with the specified `DOMMatrix`. This is equivalent to the dot product `B⋅A`, where matrix `A` is the source matrix and `B` is the matrix given as an input to the method. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`.git ## Syntax ```js-nolint - DOMMatrix.multiply( ) - DOMMatrix.multiply( otherMatrix ) + DOMMatrix.preMultiplySelf( ) + DOMMatrix.preMultiplySelf( otherMatrix ) ``` ### Parameters @@ -36,7 +34,7 @@ const matrix = new DOMMatrix().rotate(30); console.log(matrix.toString()); // output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0) -matrix.multiply(matrix); +matrix.preMultiplySelf(matrix); console.log(matrix.toString()); // output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) @@ -52,7 +50,7 @@ console.log(matrix.toString()); ## See also +- {{domxref("DOMMatrix.multiplySelf()")}} - {{domxref("DOMMatrixReadOnly.multiply()")}} -- {{domxref("DOMMatrix.preMultiplySelf()")}} - CSS {{CSSxRef("transform-function/matrix", "matrix()")}} function - CSS {{CSSxRef("transform-function/matrix3d", "matrix3d()")}} function From 7f78a7df858c842931eda0c3895bcdf011bf8d86 Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 11 Dec 2024 12:06:14 -0800 Subject: [PATCH 06/12] change examples --- files/en-us/web/api/dommatrix/multiplyself/index.md | 2 +- .../web/api/dommatrix/premultiplyself/index.md | 13 +++++++------ .../web/api/dommatrixreadonly/multiply/index.md | 9 +++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index c143a64a371efae..c6f587a542c0d40 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -39,7 +39,7 @@ console.log(matrix.toString()); matrix.multiplySelf(matrix); console.log(matrix.toString()); -// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) +// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) (a 60deg rotation) ``` ## Specifications diff --git a/files/en-us/web/api/dommatrix/premultiplyself/index.md b/files/en-us/web/api/dommatrix/premultiplyself/index.md index 4473bfc31b4c58f..be274c1e3e58dd8 100644 --- a/files/en-us/web/api/dommatrix/premultiplyself/index.md +++ b/files/en-us/web/api/dommatrix/premultiplyself/index.md @@ -29,15 +29,16 @@ Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the result ## Examples ```js -const matrix = new DOMMatrix().rotate(30); +const matrix = new DOMMatrix().translate(3, 22); +const otherMatrix = new DOMMatrix().translateSelf(15, 45); -console.log(matrix.toString()); -// output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0) +console.log(matrix.toString()); // output: matrix(1, 0, 0, 1, 3, 22) +console.log(otherMatrix.toString()); // output: matrix(1, 0, 0, 1, 15, 45) -matrix.preMultiplySelf(matrix); +matrix.preMultiplySelf(otherMatrix); -console.log(matrix.toString()); -// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) +console.log(matrix.toString()); // output: matrix(1, 0, 0, 1, 18, 67) +console.log(otherMatrix.toString()); // output: matrix(1, 0, 0, 1, 15, 45) ``` ## Specifications diff --git a/files/en-us/web/api/dommatrixreadonly/multiply/index.md b/files/en-us/web/api/dommatrixreadonly/multiply/index.md index c3564bb5f542f23..bf5f5ab2a711017 100644 --- a/files/en-us/web/api/dommatrixreadonly/multiply/index.md +++ b/files/en-us/web/api/dommatrixreadonly/multiply/index.md @@ -31,13 +31,10 @@ Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the result ## Examples ```js -const matrix = new DOMMatrixReadOnly().rotate(30); +const matrix = new DOMMatrixReadOnly().translate(13, 21); const multipliedMatrix = matrix.multiply(matrix); - -console.log(matrix.toString()); -// output: matrix(0.866, 0.5, -0.5, 0.866, 0, 0) -console.log(multipliedMatrix.toString()); -// output: matrix(0.5, 0.866, -0.866, 0.5, 0, 0) +console.log(matrix.toString()); // output: matrix(1, 0, 0, 1, 13, 21) +console.log(multipliedMatrix.toString()); // output: matrix(1, 0, 0, 1, 26, 42) ``` ## Specifications From c1135d69bf7a251e07135498594322798b34a2b3 Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 11 Dec 2024 13:02:58 -0800 Subject: [PATCH 07/12] return values --- files/en-us/web/api/dommatrix/multiplyself/index.md | 2 +- files/en-us/web/api/dommatrix/premultiplyself/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index c6f587a542c0d40..1341b5bc5c26490 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -26,7 +26,7 @@ To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multi ### Return value -Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the results of the applied multiplications. +Returns itself; the [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) updated to the results of the applied multiplications. ## Examples diff --git a/files/en-us/web/api/dommatrix/premultiplyself/index.md b/files/en-us/web/api/dommatrix/premultiplyself/index.md index be274c1e3e58dd8..310979bffbae905 100644 --- a/files/en-us/web/api/dommatrix/premultiplyself/index.md +++ b/files/en-us/web/api/dommatrix/premultiplyself/index.md @@ -24,7 +24,7 @@ The **`preMultiplySelf()`** method of the {{domxref("DOMMatrix")}} interface Mod ### Return value -Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the results of the applied multiplications. +Returns itself; a [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) updated to results of the applied multiplications. ## Examples From f276994298940de0f426e3bc670ea7d9c94f087b Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 12 Dec 2024 13:23:25 -0800 Subject: [PATCH 08/12] return --- files/en-us/web/api/dommatrixreadonly/multiply/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/dommatrixreadonly/multiply/index.md b/files/en-us/web/api/dommatrixreadonly/multiply/index.md index bf5f5ab2a711017..c1be905866ea5f1 100644 --- a/files/en-us/web/api/dommatrixreadonly/multiply/index.md +++ b/files/en-us/web/api/dommatrixreadonly/multiply/index.md @@ -26,7 +26,7 @@ To mutate the matrix as you multiply it, see {{domxref("DOMMatrix.multiplySelf() ### Return value -Returns a new [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing the results of the applied multiplications. +A {{domxref("DOMMatrixReadOnly")}}. ## Examples From d0c617292dab1070010382ba37b3ab40beef4ea4 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 12 Dec 2024 13:24:11 -0800 Subject: [PATCH 09/12] Update index.md --- files/en-us/web/api/dommatrixreadonly/multiply/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/dommatrixreadonly/multiply/index.md b/files/en-us/web/api/dommatrixreadonly/multiply/index.md index c1be905866ea5f1..68529a969a436d9 100644 --- a/files/en-us/web/api/dommatrixreadonly/multiply/index.md +++ b/files/en-us/web/api/dommatrixreadonly/multiply/index.md @@ -26,7 +26,7 @@ To mutate the matrix as you multiply it, see {{domxref("DOMMatrix.multiplySelf() ### Return value -A {{domxref("DOMMatrixReadOnly")}}. +A {{domxref("DOMMatrix")}}. ## Examples From 8b3dbf68e10211aea359db2c0ed0be6f3c9e5468 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 9 Jan 2025 23:45:41 -0800 Subject: [PATCH 10/12] Apply suggestions from code review Co-authored-by: wbamberg --- files/en-us/web/api/dommatrix/multiplyself/index.md | 4 ++-- files/en-us/web/api/dommatrix/premultiplyself/index.md | 2 +- files/en-us/web/api/dommatrixreadonly/multiply/index.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index 1341b5bc5c26490..0f9e057ba2cb274 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -8,9 +8,9 @@ browser-compat: api.DOMMatrix.multiplySelf {{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} -The **`multiplySelf()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the matrix parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. +The **`multiplySelf()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the`otherMatrix` parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. -To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multiply()")}} +To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multiply()")}}. ## Syntax diff --git a/files/en-us/web/api/dommatrix/premultiplyself/index.md b/files/en-us/web/api/dommatrix/premultiplyself/index.md index 310979bffbae905..1332be663a5d20a 100644 --- a/files/en-us/web/api/dommatrix/premultiplyself/index.md +++ b/files/en-us/web/api/dommatrix/premultiplyself/index.md @@ -8,7 +8,7 @@ browser-compat: api.DOMMatrix.preMultiplySelf {{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} -The **`preMultiplySelf()`** method of the {{domxref("DOMMatrix")}} interface Modifies the matrix by pre-multiplying it with the specified `DOMMatrix`. This is equivalent to the dot product `B⋅A`, where matrix `A` is the source matrix and `B` is the matrix given as an input to the method. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`.git +The **`preMultiplySelf()`** method of the {{domxref("DOMMatrix")}} interface modifies the matrix by pre-multiplying it with the specified `DOMMatrix`. This is equivalent to the dot product `B⋅A`, where matrix `A` is the source matrix and `B` is the matrix given as an input to the method. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. ## Syntax diff --git a/files/en-us/web/api/dommatrixreadonly/multiply/index.md b/files/en-us/web/api/dommatrixreadonly/multiply/index.md index 68529a969a436d9..43dc191867437e4 100644 --- a/files/en-us/web/api/dommatrixreadonly/multiply/index.md +++ b/files/en-us/web/api/dommatrixreadonly/multiply/index.md @@ -8,9 +8,9 @@ browser-compat: api.DOMMatrixReadOnly.multiply {{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} -The **`multiply()`** method of the {{domxref("DOMMatrixReadOnly")}} interface creates a new matrix being the result of the multiplication of the original matrix. The method returns a new {{domxref("DOMMatrix")}} created by computing the dot product of the source matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. The original matrix is not modified. +The **`multiply()`** method of the {{domxref("DOMMatrixReadOnly")}} interface creates and returns a new matrix which is the dot product of the matrix and the `otherMatrix` parameter. If `otherMatrix` is omitted, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. The original matrix is not modified. -To mutate the matrix as you multiply it, see {{domxref("DOMMatrix.multiplySelf()")}} +To mutate the matrix as you multiply it, see {{domxref("DOMMatrix.multiplySelf()")}}. ## Syntax From 04d65f80a0944e4b42aa4c5dd1332c7ae7efdfeb Mon Sep 17 00:00:00 2001 From: estelle Date: Thu, 9 Jan 2025 23:48:30 -0800 Subject: [PATCH 11/12] edits per review --- files/en-us/web/api/dommatrix/multiplyself/index.md | 6 +++--- files/en-us/web/api/dommatrix/premultiplyself/index.md | 6 +++--- files/en-us/web/api/dommatrixreadonly/multiply/index.md | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index 0f9e057ba2cb274..a24146a40587301 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -15,13 +15,13 @@ To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multi ## Syntax ```js-nolint - DOMMatrix.multiplySelf( ) - DOMMatrix.multiplySelf( otherMatrix ) + DOMMatrix.multiplySelf() + DOMMatrix.multiplySelf(otherMatrix) ``` ### Parameters -- `otherMatrix` +- `otherMatrix` {{optional_inline}} - : The [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) multiplier. ### Return value diff --git a/files/en-us/web/api/dommatrix/premultiplyself/index.md b/files/en-us/web/api/dommatrix/premultiplyself/index.md index 1332be663a5d20a..3faf6c045298a47 100644 --- a/files/en-us/web/api/dommatrix/premultiplyself/index.md +++ b/files/en-us/web/api/dommatrix/premultiplyself/index.md @@ -13,13 +13,13 @@ The **`preMultiplySelf()`** method of the {{domxref("DOMMatrix")}} interface mod ## Syntax ```js-nolint - DOMMatrix.preMultiplySelf( ) - DOMMatrix.preMultiplySelf( otherMatrix ) + DOMMatrix.preMultiplySelf() + DOMMatrix.preMultiplySelf(otherMatrix) ``` ### Parameters -- `otherMatrix` +- `otherMatrix` {{optional_inline}} - : The [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) multiplier. ### Return value diff --git a/files/en-us/web/api/dommatrixreadonly/multiply/index.md b/files/en-us/web/api/dommatrixreadonly/multiply/index.md index 43dc191867437e4..a331fda5e96478b 100644 --- a/files/en-us/web/api/dommatrixreadonly/multiply/index.md +++ b/files/en-us/web/api/dommatrixreadonly/multiply/index.md @@ -15,13 +15,13 @@ To mutate the matrix as you multiply it, see {{domxref("DOMMatrix.multiplySelf() ## Syntax ```js-nolint - DOMMatrixReadOnly.multiply( ) - DOMMatrixReadOnly.multiply( otherMatrix ) + DOMMatrixReadOnly.multiply() + DOMMatrixReadOnly.multiply(otherMatrix) ``` ### Parameters -- `otherMatrix` +- `otherMatrix` {{optional_inline}} - : The [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) multiplier. ### Return value From 98437b6faf1a8c32c878800badb2fab5041f3bc5 Mon Sep 17 00:00:00 2001 From: wbamberg Date: Fri, 10 Jan 2025 11:10:30 -0800 Subject: [PATCH 12/12] Update files/en-us/web/api/dommatrix/multiplyself/index.md --- files/en-us/web/api/dommatrix/multiplyself/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/dommatrix/multiplyself/index.md b/files/en-us/web/api/dommatrix/multiplyself/index.md index a24146a40587301..d3e8fc4c3dedc7d 100644 --- a/files/en-us/web/api/dommatrix/multiplyself/index.md +++ b/files/en-us/web/api/dommatrix/multiplyself/index.md @@ -8,7 +8,7 @@ browser-compat: api.DOMMatrix.multiplySelf {{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} -The **`multiplySelf()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the`otherMatrix` parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. +The **`multiplySelf()`** method of the {{domxref("DOMMatrix")}} interface multiplies a matrix by the `otherMatrix` parameter, computing the dot product of the original matrix and the specified matrix: `A⋅B`. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is `0` _except_ the bottom-right corner and the element immediately above and to its left: `m33` and `m34`. These have the default value of `1`. To multiply a matrix without mutating it, see {{domxref("DOMMatrixReadOnly.multiply()")}}.