Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

3D Rotation which is correct

  1. Dec 4, 2007 #1

    IMK

    User Avatar

    Hello,
    I and just getting to grips with basic 3D rotation and have come across two nice examples, however they are different when calculating the Y axis rotation and I was wondering why and which is correct ? Or are they both correct for some convention I have mist?
    Many thank IMK

    1:
    Yout = Yin;
    Xout = Xin * cos(Theta) - Zin * sin(Theta)
    Zout = Zin * cos(Theta) + Xin * sin(Theta)

    2:
    Yout = Yin;
    Xout = Zin * sin(Theta) + Xin * cos(Theta)
    Zout = Zin * cos(Theta) - Xin * sin(Theta)
     
  2. jcsd
  3. Dec 4, 2007 #2

    Mute

    User Avatar
    Homework Helper

    Both are correct, they just rotate about the y axis in different directions (one clockwise, the other counterclockwise).

    Do you know any linear algebra? It's much clearer to see these things when written out in matrix form - each rotation is described by a rotation matrix, and when you multiply the two rotation matrices together you get the identity matrix. What this tells you is that one rotation cancels out the other, so they must be rotations in opposite directions.
     
  4. Dec 4, 2007 #3

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    IMK, could you show where you found those two examples?
     
  5. Dec 4, 2007 #4

    IMK

    User Avatar

    Mute, many many thanks for your reply as every little input helps me a great deal as my maths is both poor and rusty.

    So good to know these are both correct and I guess I can use the one that fits my problem. Question does the same rule apply to the rotation about the X and Z axis that I can simply swap the cos sin +- around to control the direct? Or is there some lurking monster?

    Are far as the linear algebra well I read and learn more every day but I must admit I am REALLY STUCK as far as rotation matrixes are concerned. As I have searched the web for days to find a simple (software (C if possible)) implementation of them. As all the code I can find has been written for computer graphics and does view rotation, camera and lighting etc and is much to complicated and hence confusing as all I want to do is to rotate some force vectors.

    So if you happen to know of a simple C implement of a rotation matrix then I would be doing double backward summersaults.

    Again many thanks for you input IMK
     
  6. Dec 4, 2007 #5

    IMK

    User Avatar

  7. Dec 4, 2007 #6

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    and from another thread,

    Did you read my post in that other thread? You are guilty here of using rotate and transform as synonyms. There are not. They are conjugates. Those force vectors you want to "rotate" are real things. You do not want to rotate them; you want to transform them from one frame to another. The frames are rotated with respect to each other. Vector representations are transformed between frames. Rotation and transformation are conjugates, which is why you have conjugate representations of the pitch matrix in your OP in this thread.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: 3D Rotation which is correct
  1. 3D Rotation (Replies: 9)

Loading...