Which 3D Rotation Calculation is Correct?

  • Context: High School 
  • Thread starter Thread starter IMK
  • Start date Start date
  • Tags Tags
    3d Rotation
Click For Summary

Discussion Overview

The discussion revolves around the calculation of 3D rotations, specifically focusing on two different mathematical representations for rotating vectors about the Y-axis. Participants explore the implications of these representations and their correctness, while also touching on related concepts of rotation matrices and transformations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • IMK presents two different formulas for Y-axis rotation and questions their correctness and conventions.
  • One participant asserts that both formulas are correct but represent rotations in opposite directions (clockwise vs. counterclockwise).
  • IMK expresses a desire to understand if similar rules apply for rotations about the X and Z axes and whether adjustments can be made to the formulas to control direction.
  • IMK seeks a simple implementation of rotation matrices in C, indicating difficulty in finding accessible resources that do not involve complex graphics applications.
  • Another participant clarifies the distinction between "rotating" and "transforming" vectors, emphasizing that the goal is to transform vectors between frames rather than rotate them in a traditional sense.

Areas of Agreement / Disagreement

Participants generally agree that both rotation formulas are valid but differ in direction. However, there is no consensus on the application of similar rules for rotations about other axes or on the distinction between rotation and transformation.

Contextual Notes

Participants express uncertainty regarding the application of rotation rules to different axes and the implications of using rotation versus transformation terminology. There is also a noted difficulty in finding straightforward implementations of rotation matrices.

Who May Find This Useful

This discussion may be useful for individuals learning about 3D rotations, particularly in the context of physics or engineering applications, as well as those seeking to implement rotation matrices in programming.

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:

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
67
Views
5K
Replies
1
Views
2K
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K