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.
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.
|
double getA()
void setA(double arg)
double getB()
void setB(double arg)
double getC()
void setC(double arg)
double getD()
void setD(double arg)
double getE()
void setE(double arg)
double getF()
void setF(double arg)
SVGMatrix flipX()
SVGMatrix flipY()
SVGMatrix inverse()
Return the inverse matrix
Exceptions:
DOMException
with code SVG_MATRIX_NOT_INVERTABLE
is raised if the matrix is not invertable.SVGMatrix multiply(SVGMatrix secondMatrix)
SVGMatrix rotate(float angle)
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:
DOMException
with code SVG_INVALID_VALUE_ERR
is raised if one of the parameters has an invalid value.SVGMatrix scale(float scaleFactor)
SVGMatrix scaleNonUniform(float scaleFactorX, float scaleFactorY)
SVGMatrix skewX(float angle)
SVGMatrix skewY(float angle)
SVGMatrix translate(float x, float y)
Copyright © 2016. All rights reserved.