Which 3D Rotation Calculation is Correct?

  • Thread starter Thread starter IMK
  • Start date Start date
  • Tags Tags
    3d Rotation
AI Thread Summary
The discussion centers on the differences in two 3D rotation calculations around the Y-axis, with both methods being correct but representing opposite rotational directions. The importance of using rotation matrices for clarity in understanding these rotations is emphasized, as they can illustrate how one rotation cancels out the other. The original poster seeks a simpler implementation of rotation matrices in C, specifically for rotating force vectors rather than complex graphics applications. Additionally, a distinction is made between rotation and transformation, highlighting that the goal is to transform vectors between frames rather than merely rotating them. Overall, the conversation underscores the complexity of 3D rotations and the need for clear mathematical representations.
IMK
Messages
61
Reaction score
0
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)
 
Mathematics news on Phys.org
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.
 
IMK, could you show where you found those two examples?
 
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
 
D H said:
IMK, could you show where you found those two examples?

http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm
http://forums.sagamedev.com/topic.aspx?topicid=308

If you find a simple matrix implementation for rotation only, no graphics project etc etc.. Then please let me know..
Of out for dinner now but will be back about 2230 uk time..

Many tahnks IMK
 
Last edited by a moderator:
IMK said:
I want to do is to rotate some force vectors.

and from another thread,

IMK said:
Basically I have a set of 3D Accelerometer force vectors that I am trying to rotate in order to align them with another set of calibration vectors from the same device.

Did you read https://www.physicsforums.com/showthread.php?p=1526764#post1526764"? 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.
 
Last edited by a moderator:
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top