- All Known Implementing Classes:
- AbstractSVGMatrix,- SVGOMMatrix
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]
- 
Method SummaryModifier and TypeMethodDescriptionflipX()Post-multiplies the transformation[-1 0 0 1 0 0]and returns the resulting matrix.flipY()Post-multiplies the transformation[1 0 0 -1 0 0]and returns the resulting matrix.floatgetA()floatgetB()floatgetC()floatgetD()floatgetE()floatgetF()inverse()Performs matrix multiplication.rotate(float angle) Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.rotateFromVector(float x, float y) Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.scale(float scaleFactor) Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix.scaleNonUniform(float scaleFactorX, float scaleFactorY) Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix.voidsetA(float a) Set theacomponent of the matrix.voidsetB(float b) Set thebcomponent of the matrix.voidsetC(float c) Set theccomponent of the matrix.voidsetD(float d) Set thedcomponent of the matrix.voidsetE(float e) Set theecomponent of the matrix.voidsetF(float f) Set thefcomponent of the matrix.skewX(float angle) Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix.skewY(float angle) Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix.translate(float x, float y) Post-multiplies a translation transformation on the current matrix and returns the resulting matrix.
- 
Method Details- 
getAfloat getA()- Returns:
- the acomponent of the matrix.
 
- 
setASet theacomponent of the matrix.- Parameters:
- a- the- acomponent of the matrix.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute.
 
- 
getBfloat getB()- Returns:
- the bcomponent of the matrix.
 
- 
setBSet thebcomponent of the matrix.- Parameters:
- b- the- bcomponent of the matrix.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute.
 
- 
getCfloat getC()- Returns:
- the ccomponent of the matrix.
 
- 
setCSet theccomponent of the matrix.- Parameters:
- c- the- ccomponent of the matrix.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute.
 
- 
getDfloat getD()- Returns:
- the dcomponent of the matrix.
 
- 
setDSet thedcomponent of the matrix.- Parameters:
- d- the- dcomponent of the matrix.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute.
 
- 
getEfloat getE()- Returns:
- the ecomponent of the matrix.
 
- 
setESet theecomponent of the matrix.- Parameters:
- e- the- ecomponent of the matrix.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute.
 
- 
getFfloat getF()- Returns:
- the fcomponent of the matrix.
 
- 
setFSet thefcomponent of the matrix.- Parameters:
- f- the- fcomponent of the matrix.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute.
 
- 
multiplyPerforms matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix.- Parameters:
- secondMatrix- the matrix which is post-multiplied to this matrix.
- Returns:
- the resulting matrix.
 
- 
inverse- Returns:
- the inverse matrix.
- Throws:
- SVGException- SVG_MATRIX_NOT_INVERTABLE if this matrix is not invertible.
 
- 
translatePost-multiplies a translation transformation on the current matrix and returns the resulting matrix.- Parameters:
- x- the distance to translate along the x-axis.
- y- the distance to translate along the y-axis.
- Returns:
- the resulting matrix.
 
- 
scalePost-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix.- Parameters:
- scaleFactor- the scale factor in both X and Y.
- Returns:
- the resulting matrix.
 
- 
scaleNonUniformPost-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix.- Parameters:
- scaleFactorX- the scale factor in X.
- scaleFactorY- the scale factor in Y.
- Returns:
- the resulting matrix.
 
- 
rotatePost-multiplies a rotation transformation on the current matrix and returns the resulting matrix.- Parameters:
- angle- the rotation angle.
- Returns:
- the resulting matrix.
 
- 
rotateFromVectorPost-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.- Parameters:
- x- the X coordinate of the vector- (x, y). Must not be zero.
- y- the Y coordinate of the vector- (x, y). Must not be zero.
- Returns:
- the resulting matrix.
- Throws:
- SVGException- SVG_INVALID_VALUE_ERR if one of the parameters is an invalid value.
 
- 
flipXSVGMatrix flipX()Post-multiplies the transformation[-1 0 0 1 0 0]and returns the resulting matrix.- Returns:
- the resulting matrix.
 
- 
flipYSVGMatrix flipY()Post-multiplies the transformation[1 0 0 -1 0 0]and returns the resulting matrix.- Returns:
- the resulting matrix.
 
- 
skewXPost-multiplies a skewX transformation on the current matrix and returns the resulting matrix.- Parameters:
- angle- the skew angle.
- Returns:
- the resulting matrix.
 
- 
skewYPost-multiplies a skewY transformation on the current matrix and returns the resulting matrix.- Parameters:
- angle- the skew angle.
- Returns:
- the resulting matrix.
 
 
-