Online Shopping : Science : Mathematics : Algebra : Linear

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

20 of 49 people (41%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

Math: Transformation: Rotation: 3D: Can you derive the rotation formula?

Apr 2nd, 2009 07:47
engatoo engatoo, Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 30 January 2006 - 01:33 am --------------------
Math: Transformation: Rotation: 3D: Can you derive the rotation 
formula?
---
According to 'Euler's rotation theorem', any rotation may be described
using three angles.
---
If the rotations are written in terms of rotation matrices B, C, and D,
then a general rotation A can be written as
 A = B . C . D
(in other words you perform a matrix multiplication of 3 matrices,
 in the order shown, to get the final rotation.
 A = ( ( B . C ) . D )
---
The three angles giving the three rotation matrices are called Euler
angles.
 E.g.
 1. xAngle
 2. yAngle
 3. zAngle
---
There are several conventions for Euler angles, depending on the axes 
about which the rotations are carried out
(usually 12 possibilities total).
===
To get this general rotation matrix A,
which combines thus the rotations around each of the 3 axes,
the possibly easiest method is the following:
1. You split the rotation in a rotation around each axis separately.
   (this can be seen as a 2D rotation, with the 3th axis kept constant.
    Thus the same formula for the 2D rotation pops all the time up, 
written
    in the correct position in the 3D matrix, and in the other 
positions
    zeroes, and a 1 at the position of the axis around which you 
rotate)
2. Then you create any rotation by combining rotations around each
   axis
3. In this case you combine
   1. a rotation around the x-axis
   2. followed by a rotation around the y-axis
   3. followed by a rotation around the z-axis
===
Steps: Overview:
 1. Rotation solely around the x-axis
    (this leaves the x-coordinates unchanged, as the rotation only
    takes place in the yz plane, thus xbefore equals xafter)
     x = x
     y =  cos( xAngleR ) . x + sin( xAngleR ) . z
     z =  sin( xAngleR ) . x - cos( xAngleR ) . z
    or thus written out in full, to see the structure
    better
     x =  1 . x +               0 . y +              0 . z
     y =  0 . x +  cos( xAngleR ) . y + sin( xAngleR ) . z
     z =  0 . x +  sin( xAngleR ) . y - cos( xAngleR ) . z
    if you put this in a matrix it becomes
     [  1             0   0            ]
     [                                 ]
     [  0   cos(xAngleR)  sin(xAngleR) ]
     [                                 ]
     [  0   sin(xAngleR) -cos(xAngleR) ]
 2. Rotation solely around the y-axis
    (this leaves the y-coordinates unchanged, as the rotation only
     takes place in the xz plane, thus ybefore equals yafter)
     x =  cos( yAngleR ) . x + sin( yAngleR ) . z
     y = y
     z =  sin( yAngleR ) . x - cos( yAngleR ) . z
    or thus written out in full, to see the structure
    better
     x =   cos( yAngleR ) . x +  0 . y + sin( yAngleR ) . z
     y =                0 . x +  1 . y +              0 . z
     z =   sin( yAngleR ) . x +  0 . y - cos( yAngleR ) . z
    if you put this in a matrix it becomes
     [  cos(yAngleR)    0   sin(yAngleR) ]
     [                                   ]
     [  0               1             0  ]
     [                                   ]
     [  sin(yAngleR)    0  -cos(yAngleR) ]
 3. Rotation solely around the z-axis
    (this leaves the z-coordinates unchanged, as the rotation only
     takes place in the xy plane, thus zbefore equals zafter)
     x =  cos( zAngleR ) . x + sin( zAngleR ) . y
     z =  sin( zAngleR ) . x - cos( zAngleR ) . y
     z = z
    or thus written out in full, to see the structure
    better
     x =  cos( zAngleR ) . x + sin( zAngleR ) . y + 0 . z
     y =  sin( zAngleR ) . x - cos( zAngleR ) . y + 0 . z
     z =               0 . x +              0 . y + 1 . z
    if you put this in a matrix it becomes
     [  cos(zAngleR)    sin(zAngleR)  0 ]
     [                                  ]
     [  sin(zAngleR)   -cos(zAngleR)  0 ]
     [                                  ]
     [  0               0             1 ]
 4. If you want to combine rotations around say first the
    x-axis, then the y-axis, then the z-axis, you can perform
    this in steps, to do it in the simplest way.
    1. First do a matrix multiplication of the x-matrix with the
       y-matrix.
[ 1            0   0            ]   [ cos(yAngleR) 0  sin(yAngleR) ]
[ 0  cos(xAngleR)  sin(xAngleR) ] . [ 0            1            0  ] =
[ 0  sin(xAngleR) -cos(xAngleR) ]   [ sin(yAngleR) 0 -cos(yAngleR) ]
    1. Then do a matrix multiplication of the result of this with the
       z-matrix.
 5. Note:
    1. -To check if you write your 2D rotation matrix correct,
        notice that the 2D determinant all the time equals 1
        in absolute value.
        The structure which all the time reoccurs is
         cos  sin
         sin -cos
        of which the determinant is
         (cos) . (-cos) - (sin) . (sin)
                     2      2
         or thus -cos  - sin
        and using Pythagoras, this says
        that
            2      2
         sin  + cos  = 1
        So this matrices fullfil this demand.
        That gives you thus a way to quickly write this
        matrix out of your head.
    2. -To get the x-y-z rotation, you matrix multiply it in
        this order.
        This is also something which you systematically can
        do, rather quickly, e.g. using a piece of paper.
---
---
Internet: see also:
---
Math: Transformation: Rotation: Link: Can you give an overview of 
links?
http://www.faqts.com/knowledge_base/view.phtml/aid/39299/fid/1856
http://www.roo7e.com
http://www.roo7e.com
http://www.al33ab.com
http://ksacam.com
http://chat.ksacam.com
http://ksacam.info
http://oo2o.com
http://s4cam.com
http://saudi4cam.com				
http://voice.ksacam.com
http://سعودي-كام.oo2o.com
http://سعوديكام.com
http://xn--mgbply5cnrr.com
http://www.3rabstarz.com/vb
http://www.3rabstarz.com/vb
http://www.3rabstarz.com/
http://www.3rabstarz.com/vb
http://www.3rabstarz.com/
http://www.dir.3rabstarz.com/
http://www.up.3rabstarz.com
http://www.3rabstarz.com/vb/forumdisplay.php?f=5
http://www.3rabstarz.com/vb/forumdisplay.php?f=116
http://www.3rabstarz.com/vb/forumdisplay.php?f=66
http://www.3rabstarz.com/vb/forumdisplay.php?f=78
http://www.3rabstarz.com/vb/forumdisplay.php?f=147
http://www.3rabstarz.com/vb/forumdisplay.php?f=2
http://www.3rabstarz.com/vb/forumdisplay.php?f=31
http://www.3rabstarz.com/vb/forumdisplay.php?f=136
http://www.3rabstarz.com/vb/forumdisplay.php?f=34
http://www.3rabstarz.com/vb/forumdisplay.php?f=89
http://www.3rabstarz.com/vb/forumdisplay.php?f=26
http://www.3rabstarz.com/vb/forumdisplay.php?f=72
http://www.3rabstarz.com/vb/forumdisplay.php?f=73
http://www.3rabstarz.com/vb/forumdisplay.php?f=149
http://www.3rabstarz.com/vb/forumdisplay.php?f=150
http://www.3rabstarz.com/vb/forumdisplay.php?f=151
http://www.3rabstarz.com/vb/forumdisplay.php?f=152
http://www.3rabstarz.com/vb/forumdisplay.php?f=67
http://www.3rabstarz.com/vb/forumdisplay.php?f=3
http://www.3rabstarz.com/vb/forumdisplay.php?f=37
http://www.3rabstarz.com/vb/forumdisplay.php?f=115
http://www.3rabstarz.com/vb/forumdisplay.php?f=76
http://www.3rabstarz.com/vb/forumdisplay.php?f=77
http://www.3rabstarz.com/vb/forumdisplay.php?f=36
http://www.3rabstarz.com/vb/forumdisplay.php?f=153
http://www.3rabstarz.com/vb/forumdisplay.php?f=122
http://www.3rabstarz.com/vb/forumdisplay.php?f=118
http://www.3rabstarz.com/vb/forumdisplay.php?f=119
http://www.3rabstarz.com/vb/forumdisplay.php?f=120
http://www.3rabstarz.com/vb/forumdisplay.php?f=121
http://www.3rabstarz.com/vb/forumdisplay.php?f=35
http://www.3rabstarz.com/vb/forumdisplay.php?f=65
http://www.3rabstarz.com/vb/forumdisplay.php?f=7
http://www.3rabstarz.com/vb/forumdisplay.php?f=9
http://www.3rabstarz.com/vb/forumdisplay.php?f=11
http://www.3rabstarz.com/vb/forumdisplay.php?f=142
http://www.3rabstarz.com/vb/forumdisplay.php?f=143
http://www.3rabstarz.com/vb/forumdisplay.php?f=146
http://www.3rabstarz.com/vb/forumdisplay.php?f=140
http://www.3rabstarz.com/vb/forumdisplay.php?f=137
http://www.3rabstarz.com/vb/forumdisplay.php?f=114
http://www.3rabstarz.com/vb/forumdisplay.php?f=117
http://www.3rabstarz.com/vb/forumdisplay.php?f=113
http://www.3rabstarz.com/vb/forumdisplay.php?f=51
http://www.3rabstarz.com/vb/forumdisplay.php?f=84
http://www.3rabstarz.com/vb/forumdisplay.php?f=138
http://www.3rabstarz.com/vb/forumdisplay.php?f=139
http://www.3rabstarz.com/vb/forumdisplay.php?f=15
http://www.3rabstarz.com/vb/forumdisplay.php?f=130
http://www.3rabstarz.com/vb/forumdisplay.php?f=97
http://www.3rabstarz.com/vb/forumdisplay.php?f=102
http://www.3rabstarz.com/vb/forumdisplay.php?f=101
http://www.3rabstarz.com/vb/forumdisplay.php?f=104
http://www.3rabstarz.com/vb/forumdisplay.php?f=131
http://www.3rabstarz.com/vb/forumdisplay.php?f=103
http://www.3rabstarz.com/vb/forumdisplay.php?f=99
http://www.3rabstarz.com/vb/forumdisplay.php?f=59
http://www.3rabstarz.com/vb/forumdisplay.php?f=60
http://www.3rabstarz.com/vb/forumdisplay.php?f=39
http://www.3rabstarz.com/vb/forumdisplay.php?f=40
http://www.3rabstarz.com/vb/forumdisplay.php?f=42
http://www.3rabstarz.com/vb/forumdisplay.php?f=4
http://www.3rabstarz.com/vb/forumdisplay.php?f=1
http://www.3rabstarz.com/vb/forumdisplay.php?f=88
http://www.3rabstarz.com/vb/forumdisplay.php?f=148
http://www.3rabstarz.com/vb/forumdisplay.php?f=62
http://www.3rabstarz.com/vb/forumdisplay.php?f=63
http://www.3rabstarz.com/vb/forumdisplay.php?f=64
http://www.3rabstarz.com/vb/forumdisplay.php?f=6
http://www.3rabstarz.com/vb/forumdisplay.php?f=12
http://www.3rabstarz.com/vb/forumdisplay.php?f=96
http://www.3rabstarz.com/vb/forumdisplay.php?f=58
http://www.3rabstarz.com/vb/forumdisplay.php?f=38
----------------------------------------------------------------------