Matrix
Many of SVG's graphics operations utilize 2x3 matrices of the form:
Documentation SVGMatrix by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
a: Float
A float representing the a component of the matrix.
b: Float
A float representing the b component of the matrix.
c: Float
A float representing the c component of the matrix.
d: Float
A float representing the d component of the matrix.
e: Float
A float representing the e component of the matrix.
f: Float
A float representing the f component of the matrix.
Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix as SVGMatrix
.
Name | Type |
---|---|
secondMatrix |
Matrix |
Returns |
---|
Matrix |
inverse(): Matrix
Returns the inverse matrix as SVGMatrix
.
Returns |
---|
Matrix |
Post-multiplies a translation transformation on the current matrix and returns the resulting matrix as SVGMatrix
.
Name | Type |
---|---|
x |
Float |
y |
Float |
Returns |
---|
Matrix |
Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix as SVGMatrix
.
Name | Type |
---|---|
scaleFactor |
Float |
Returns |
---|
Matrix |
Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix as SVGMatrix
.
Name | Type |
---|---|
scaleFactorX |
Float |
scaleFactorY |
Float |
Returns |
---|
Matrix |
Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix as SVGMatrix
.
Name | Type |
---|---|
angle |
Float |
Returns |
---|
Matrix |
Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix as SVGMatrix
. The rotation angle is determined by taking (+/-) atan(y/x). The direction of the vector (x, y) determines whether the positive or negative angle value is used.
Name | Type |
---|---|
x |
Float |
y |
Float |
Returns |
---|
Matrix |
flipX(): Matrix
Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix as SVGMatrix
.
Returns |
---|
Matrix |
flipY(): Matrix
Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix as SVGMatrix
.
Returns |
---|
Matrix |
Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix as SVGMatrix
.
Name | Type |
---|---|
angle |
Float |
Returns |
---|
Matrix |
Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix as SVGMatrix
.
Name | Type |
---|---|
angle |
Float |
Returns |
---|
Matrix |