A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly/scale3d below:

DOMMatrixReadOnly: scale3d() method - Web APIs

Syntax
scale3d()
scale3d(scale)
scale3d(scale, originX)
scale3d(scale, originX, originY)
scale3d(scale, originX, originY, originZ)
Parameters
scale

A multiplier; the scale value. If no scale is supplied, this defaults to 1.

originX Optional

An x-coordinate for the origin of the transformation. If no origin is supplied, this defaults to 0.

originY Optional

A y-coordinate for the origin of the transformation. If no origin is supplied, this defaults to 0.

originZ Optional

A z-coordinate for the origin of the transformation. If this value is 0, the default if omitted, the resulting matrix may not be 3d.

Return value

A DOMMatrix.

Examples
const matrix = new DOMMatrix();
console.log(matrix.toString()); // no transforms applied
// matrix(1, 0, 0, 1, 0, 0)

console.log(matrix.scale3d(2).toString());
/* matrix3d(
    2, 0, 0, 0, 
    0, 2, 0, 0, 
    0, 0, 2, 0, 
    0, 0, 0, 1) */
console.log(matrix.scale3d(0.5, 25, 25, 1.25).toString());
/* matrix3d(
    0.5, 0, 0, 0, 
    0, 0.5, 0, 0, 
    0, 0, 0.5, 0, 1
    2.5, 12.5, 0.625, 1) */
console.log(matrix.toString()); // original matrix is unchanged
// matrix(1, 0, 0, 1, 0, 0)
Specifications Browser compatibility

Loading…

See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4