matrix
Creates a matrix transform string.
The SVG matrix(a, b, c, d, e, f) is a 2D affine transform with the matrix layout: b d f 0 0 1
It maps points (x, y) to: x' = a * x + c * y + e y' = b * x + d * y + f
Parameter roles:
a— X scale and part of rotation (cos component for pure rotation).b— Y shear / mixes X into Y (sin component for rotation).c— X shear / mixes Y into X (-sin component for rotation).d— Y scale and part of rotation (cos component for pure rotation).e— X translation (tx).f— Y translation (ty).
Common examples:
Identity:
matrix(1, 0, 0, 1, 0, 0)Translate(tx, ty):
matrix(1, 0, 0, 1, tx, ty)Scale(sx, sy):
matrix(sx, 0, 0, sy, 0, 0)Rotate(θ):
matrix(cosθ, sinθ, -sinθ, cosθ, 0, 0)(θ in radians for cos/sin)SkewX(α):
matrix(1, 0, tanα, 1, 0, 0)SkewY(β):
matrix(1, tanβ, 0, 1, 0, 0)
Use this helper directly as a transform attribute value or combine it with other transform helpers via transforms(...).
Return
The matrix transform string.
Parameters
The matrix value at position (1, 1).
The matrix value at position (1, 2).
The matrix value at position (2, 1).
The matrix value at position (2, 2).
The matrix value at position (3, 1).
The matrix value at position (3, 2).