 # Seeing a Rotation Matrix

(Difference between revisions)

## Revision as of 14:09, 26 June 2006

Written by MikeD

One of the hardest things I found when learning about geometry and computer graphics was how to 'see' a rotation matrix and how they are used, they are a handy thing to have and understand in your programming toolkit for AutoCad also. I won't delve to deep into matrices or calculations, what I hope to achieve in this article is to expose a simple way for you to 'see' a rotation matrix, when I read an article on basic trig it all fell into place so that's where we'll start.

## Our use of Trigonometry

Without going into the nitty gritty of it, trig is basically about triangles, 'right' triangles to be exact and the thing they didn't teach us at school (our school anyway) was that the basic elements of trig, being sine, cosine and tangent, were all based around angles within a unit circle! This is a very important concept to remember and will be used later, so pay attention ;) (A unit circle is simply a circle with a radius of 1, a single unit.

Looking at Figure 01 above we can see that sine is on the opposite side of our angle at the centre of the circle, and cosine is adjacent to our angle. All basic stuff we remember from school but keep the circle in your head when thinking about it, this is what makes 'seeing' a rotation matrix easier as you will soon see.

### Where does sine and cosine come from?

This was a question I had since primary school, all I new back then is that you had a table full of numbers and angles (or in your calculator these days) to refer to that some genius must have made up in his spare time to help us get through math class (btw, thanks ;) ). But basically the numbers in the table are made from the sine of each angle in a unit circle. Now, when you place your triangle in a circle, as in our figure above, you can see in Figure 02 that if you double the angle to make another triangle, the 2 triangle's sine's make a 'chord' of the circle, with this we can see that the sine of an angle is exactly half of the chord of double the angle of a unit circle. Easy 'ey!