Rotating a Graphics Object

An application can rotate the flag counterclockwise through 90°, by applying:

x' = x cos 90 - y sin 90

y' = x sin 90 + y cos 90

Because cos 90 = 0 and sin 90 = 1, these equations become:

x' = - y

y' = x

The original five points are transformed: (0,0) ─ (0,0)
(0,4) ─ (-4,0)
(0,6) ─ (-6,0)
(2,4) ─ (-4,2)
(2,6) ─ (-6,2)

The following figure shows the effect of rotating the flag 90°.

Rotation Counterclockwise through 90°


[Back: Rotation Transformations]
[Next: MATRIXLF Structure for Rotating]