invert
The matrix that undoes m, e.g. to turn a pointer position on screen back into the
coordinates of a transformed layer.
A matrix that flattens the plane onto a line or a point (determinant 0, like scale(0))
cannot be undone. There is no tolerance: a nearly flat matrix is inverted, with very large
values, as long as they stay finite.
Available since v3.1.5
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
m | Matrix | The matrix to invert |
Returns
Section titled “Returns”Matrix | undefined — The inverse, or undefined when m cannot be inverted
Examples
Section titled “Examples”Pointer position in a layer
Section titled “Pointer position in a layer”Invert the layer transform to map screen coordinates back into the layer.
Not invertible
Section titled “Not invertible”A matrix that flattens the plane cannot be undone.
Related Types
Section titled “Related Types”Matrix
Section titled “Matrix”A 2D affine transformation, in the layout of CSS and SVG matrix(a, b, c, d, e, f):
