SVG Transformation

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


Graphic elements can be altered by adding a transform attribute.

<svg xmlns="">
    <rect x="0" y="0" width="30" height="30" transform="translate(10, 10)" />

Instead of the top left origin being rendered at coordinates (0, 0), it will be shown down and right, from point (10, 10).

Whole groups of elements can be transformed together, and transformations can add to one another.

<svg xmlns="">
    <g transform="rotate(45)">
        <rect x="0" y="0" width="30" height="30" />
        <circle cx="5" cy="5" r="5" transform="scale(3)" />

First, every point of the circle will be scaled with the factor 3 in relation to the origin, bringing the center of the circle to the middle of the rectangle at (15, 15) and its radius to 15. Then, the rectangle and the circle will be rotated together by 45 degrees clockwise around the origin.

Got any SVG Question?