files/en-us/web/api/svgtransform/index.md
{{APIRef("SVG")}}
The SVGTransform interface reflects one of the component transformations within an {{ domxref("SVGTransformList") }}; thus, an SVGTransform object corresponds to a single component (e.g., scale(…) or matrix(…)) within a {{ SVGAttr("transform") }} attribute.
An SVGTransform object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
SVG_TRANSFORM_* constants defined on this interface.SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY. For SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_TRANSLATE and SVG_TRANSFORM_SCALE, angle will be zero.SVGTransform object are immediately reflected in the matrix object and vice versa. In case the matrix object is changed directly (i.e., without using the methods on the SVGTransform interface itself) then the type of the SVGTransform changes to SVG_TRANSFORM_MATRIX.SVG_TRANSFORM_MATRIX, with parameter matrix defining the new transformation. Note that the values from the parameter matrix are copied.SVG_TRANSFORM_TRANSLATE, with parameters tx and ty defining the translation amounts.SVG_TRANSFORM_SCALE, with parameters sx and sy defining the scale amounts.SVG_TRANSFORM_ROTATE, with parameter angle defining the rotation angle and parameters cx and cy defining the optional center of rotation.SVG_TRANSFORM_SKEWX, with parameter angle defining the amount of skew.SVG_TRANSFORM_SKEWY, with parameter angle defining the amount of skew.SVG_TRANSFORM_UNKNOWN (0)
SVG_TRANSFORM_MATRIX (1)
matrix(…) transformation.SVG_TRANSFORM_TRANSLATE (2)
translate(…) transformation.SVG_TRANSFORM_SCALE (3)
scale(…) transformation.SVG_TRANSFORM_ROTATE (4)
rotate(…) transformation.SVG_TRANSFORM_SKEWX (5)
skewx(…) transformation.SVG_TRANSFORM_SKEWY (6)
skewy(…) transformation.{{Specifications}}
{{Compat}}