# Derivation of rotation matrices

This topic is 2774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

I'm working on my school-leaving project (Real-time 3D visualization). My teacher's asked me what rotation matrices are derived from. I mean he asked me why rotation matrices look like they do.

I can't find the derivation anywhere. I'm supposed to be able to explain him why the matrices look like they do.

I'd be very grateful if you could tell me where I could find such derivation.

Thanks:)

##### Share on other sites
I mean 3D rotation:-)

##### Share on other sites

I mean 3D rotation:-)

Well one of the easiest ways to derive a transformation matrix is to figure out what you want each basis vector to be mapped to and then use those as the columns of the matrix.

Also, dimension doesn't matter. If you can explain it for one dimension, you can explain it for any dimension.

##### Share on other sites
Inside a 3x3 rotation matrix are 3 different 3D vectors, all of which are perpendicular to each other. They describe the forward (z), right (x) and up (y) axis of the rotated space.

E.g. If we say that while you're sitting on your seat right now, we define X as pointing to your right, Y pointing up, and Z pointing out in front of you:
Current X = (1,0,0) = right
Current Y = (0,1,0) = up
Current Z = (0,0,1) = forwards

if you turn 90º to the right on your seat, that's a rotation around the up (y) axis. Your new forward direction is your old right direction, you new right direction is the opposite of the old forward direction.
New X = (0,0,-1)
New Y = (0,1,0)
New Z = (1,0,0)

If you know 2D trigonometry, you can get the same results by ignoring Y.
Current 'X' = (1,0)
Current 'Z' = (0,1)
^Plot those two points on a 2D plane, find their angle from (0,0), add 90º clockwise to their angle, and you should get the new 'X'/'Z' points.

##### Share on other sites
Well, before you can describe why a rotation matrix does the thing it's supposed to do, you first need to have some definition of what this thing it's supposed to do (ie. rotation) actually is. Now there are probably many equivalent definitions, but I think an intuitively appealing one would be:

Rotations are those transformations that map lines to lines (which implies it must be an affine transformation), and keeps distances, angles and orientation unchanged. Now the first three properties shouldn't need any clarification, but defining orientation without being able to use rotations might be a bit harder. Mathematically it of course means that the determinant of your matrix must be positive (and thus 1, since the other conditions imply that it must be either 1 or -1).

Then, since the dot product of two vectors equals the cosine of the angle between two vectors, times the product of the lengths of both vectors, the dot product is invariant under a rotation transformation as well.

Since the dot product of any two vectors from the standard basis is 0, the dot product between any two vectors from the rotated standard basis must 0 as well, which implies the dot product of two columns/rows of your rotations matrix must be 0 too, which is the definition of an orthogonal matrix. Proving the other properties of orthonormality should be trivial.

##### Share on other sites
Here's another way to derive the axis-angle rotation matrix. Start with the equation to rotate a vector v about a unit-length axis n (which you can find here). Work through the whole thing by hand, and then re-arrange the result so it's expressed as a matrix-vector multiplication. The matrix you end up with is the axis-angle rotation matrix. (Note that the 'cardinal axis' rotation matrices are just special cases of the axis-angle matrix.)

##### Share on other sites
I described an angle-axis rotation matrix on page 34 of
http://www.euclideanspace.com/physics/dynamics/collision/practical/RahilBaberCorrectionToBrianMirtich.pdf
you'll need to look at the bottom of page 7 to make sense of some of the notation.

I wasn't really trying to make it easy to understand so apologies if you find it a bit confusing but I thought it might help a little.

##### Share on other sites
I'll study your posts. Thank you guys

##### Share on other sites
Inigo Quilez wrote an interesting article that derives the 2d rotation matrix from trigonometric identities (link).

##### Share on other sites
Given a time-varying rotation matrix R, first notice that R*R^T = I, where the superscript T denotes transpose and I is the 3x3 identity matrix. Compute the time derivative to obtain R*dR^T/dt + (dR/dt)*R^T = 0. This implies that dR/dt*R^t = S, where S is a skew-symmetric matrix. The conclusion is that dR/dt = S*R. If S has entries S00 = S11 = S22 = 0, S01 = -S10 = -w2, S02 = -S20 = w1, and S12 = -S21 = -w0, then define S = skew(w) for w = (w0,w1,w2). Notice that skew(w)u = Cross(u,w). In physics terms, w is the angular acceleration.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633678
• Total Posts
3013292
×