The rotate transform rotates an element about a given coordinate by a specified angle.
The syntax of the rotate transform is shown below.
transform="rotate(a x y)"
rotate takes three parameters. The first parameter specifies the degrees of rotation
about a given point. The second and third parameters specify the coordinate point to rotate
the element about. If the second and third parameters are not supplied, the rotate is about the origin.
In the above example, the upper-right corner of the first red square is located at the
origin x=0 y=0, the upper-right corner of the second red square is also located at the origin,
and then transform="rotate(45)" is applied (rotate 45 degrees around the origin), so the second
red square is rotated around its upper-right corner around the orign by 45 degrees.
The upper-right corner of the first green square is located at coordinates x=200 y=200,
the upper-right corner of the second green square is also located at x=200 y=200, and then
transform="rotate(45 200 200)" is applied (rotate 45 around degrees coordinates x=200 y=200),
so the second green square is rotated around its upper-right corner around the coordinates
x=200 y=200 by 45 degrees.
The upper-right corner of the first yellow square is located at coordinates x=200 y=0,
the upper-right corner of the second yellow square is also located at x=200 y=0, and then
transform="rotate(45)" is applied (rotate 45 around degrees around the origin), so the
upper-right corner of the second yellow square is rotated around the origin by 45 degrees.