elemental.svg

## Interface SVGMatrix • All Known Implementing Classes:
JsSVGMatrix

`public interface SVGMatrix`

Many of SVG's graphics operations utilize 2x3 matrices of the form:

```[a c e]
[b d f]```

which, when expanded into a 3x3 matrix for the purposes of matrix arithmetic, become:

```[a c e]
[b d f]
[0 0 1]
```

An `SVGMatrix` object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.

• ### Method Summary

All Methods
Modifier and Type Method and Description
`SVGMatrix` `flipX()`
Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix.
`SVGMatrix` `flipY()`
Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix.
`double` `getA()`
`double` `getB()`
`double` `getC()`
`double` `getD()`
`double` `getE()`
`double` `getF()`
`SVGMatrix` `inverse()`
Return the inverse matrix
`SVGMatrix` `multiply(SVGMatrix secondMatrix)`
Performs matrix multiplication.
`SVGMatrix` `rotate(float angle)`
Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.
`SVGMatrix` ```rotateFromVector(float x, float y)```
Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.
`SVGMatrix` `scale(float scaleFactor)`
Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix.
`SVGMatrix` ```scaleNonUniform(float scaleFactorX, float scaleFactorY)```
Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix.
`void` `setA(double arg)`
`void` `setB(double arg)`
`void` `setC(double arg)`
`void` `setD(double arg)`
`void` `setE(double arg)`
`void` `setF(double arg)`
`SVGMatrix` `skewX(float angle)`
Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix.
`SVGMatrix` `skewY(float angle)`
Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix.
`SVGMatrix` ```translate(float x, float y)```
Post-multiplies a translation transformation on the current matrix and returns the resulting matrix.
• ### Method Detail

• #### getA

`double getA()`
• #### setA

`void setA(double arg)`
• #### getB

`double getB()`
• #### setB

`void setB(double arg)`
• #### getC

`double getC()`
• #### setC

`void setC(double arg)`
• #### getD

`double getD()`
• #### setD

`void setD(double arg)`
• #### getE

`double getE()`
• #### setE

`void setE(double arg)`
• #### getF

`double getF()`
• #### setF

`void setF(double arg)`
• #### flipX

`SVGMatrix flipX()`
Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix.
• #### flipY

`SVGMatrix flipY()`
Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix.
• #### inverse

`SVGMatrix inverse()`

Return the inverse matrix

Exceptions:

• a `DOMException` with code `SVG_MATRIX_NOT_INVERTABLE` is raised if the matrix is not invertable.
• #### multiply

`SVGMatrix multiply(SVGMatrix secondMatrix)`
Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix.
• #### rotate

`SVGMatrix rotate(float angle)`
Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.
• #### rotateFromVector

```SVGMatrix rotateFromVector(float x,
float y)```

Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix. 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.

Exceptions:

• a `DOMException` with code `SVG_INVALID_VALUE_ERR` is raised if one of the parameters has an invalid value.
• #### scale

`SVGMatrix scale(float scaleFactor)`
Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix.
• #### scaleNonUniform

```SVGMatrix scaleNonUniform(float scaleFactorX,
float scaleFactorY)```
Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix.
• #### skewX

`SVGMatrix skewX(float angle)`
Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix.
• #### skewY

`SVGMatrix skewY(float angle)`
Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix.
• #### translate

```SVGMatrix translate(float x,
float y)```
Post-multiplies a translation transformation on the current matrix and returns the resulting matrix.