Home page

Rotation using matrices

Another use for matrices is for rotating points or whole objects for example, in computer graphics.

For a given point:
( x
y
z
)

or a whole object with multiple points:
( x1
y1
z1
x2
y2
z2
x3
y3
z3
...
...
...
)

These can be multiplied with one of these matrices to rotate it:

Around the X-axis

( 1
0
0
0
Cos (a)
-Sin (a)
0
Sin (a)
Cos (a)
)


Around the Y-axis

( Cos (a)
0
-Sin (a)
0
1
0
Sin (a)
0
Cos (a)
)


Around the Z-axis

( Cos (a)
-Sin (a)
0
Sin (a)
Cos (a)
0
0
0
1
)


Note that if you swap the signs on both sines, then the direction of rotation inverts.


If you just want to rotate a two-dimentional figure, use:

( Cos (a)
-Sin (a)
Sin (a)
Cos (a)
)





Have you found an error or do you want to add more information to these pages?
You can contact me at the bottom of the home page.

Home page