Calculating Offsets on the Normal Coordinate System

Click For Summary

Discussion Overview

The discussion revolves around calculating offsets in a normal coordinate system when given the positions and rotations of two cubes. Participants explore the implications of using Euler rotations versus transformation matrices for these calculations, focusing on the conversion between local and normal coordinate systems.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes a problem with calculating the offset of cube2 relative to cube1 in a normal coordinate system, noting discrepancies based on cube1's rotation.
  • Another participant suggests using transformation matrices instead of Euler rotations for a more effective approach to describe rotations and transformations.
  • A later reply indicates confusion about the initial suggestion, mentioning that the original approach used Euler rotations and requests clarification or examples.
  • Further, a participant proposes a step-by-step method to build rotation matrices, emphasizing the importance of understanding the process before applying it to the problem at hand.
  • The same participant explains that to convert from cube1's local system back to the normal system, one would need to use the inverse of the rotation matrix, which is the transposed matrix for orthogonal matrices.

Areas of Agreement / Disagreement

Participants express differing views on the best method for calculating offsets, with some advocating for transformation matrices while others prefer Euler rotations. The discussion remains unresolved regarding the most effective approach.

Contextual Notes

There are limitations in the discussion regarding the assumptions made about the rotation methods and the specific mathematical steps required to achieve the desired transformations. The dependence on definitions of coordinate systems and rotation matrices is also noted.

chemart
Messages
6
Reaction score
0
I have problem with getting normal coordinates offset. I have cube1 and cube2. cube1 position is 10,10,10 and cube2 position is 10,9,10. Cube 2 offset refers to local coordinate system of cube1. If rotation of cube1 is 0,0,0 i get position offset 0,-1,0. But if cube1 rotation is 45,0,0 i get offset 0,-0.7071,+0.7071. The problem is that offsets don't use normal coordinate system, they use local coordiante system of cube1. How do i get offsets on normal coordinate system?
 
Physics news on Phys.org
Euler rotations are a handy way for people to visualize simple rotations. There are many better alternatives to Euler rotations for describing rotations and transformations in three space. One approach that works very nicely with linear algebra is a transformation matrix. Your Euler rotation generates a transformation matrix to go from the "normal" to "local" coordinate frames:

<br /> \vec x_{2,\text{local}} =<br /> \mathbf{T}_{\text{normal}\to\text{local}}<br /> (\vec x_{2,\text{normal}}-\vec x_{1,\text{normal}})<br />

The above equation is invertible. Since the inverse of a transformation matrix is simply the transpose,

<br /> \vec x_{2,\text{normal}} =<br /> \vec x_{1,\text{normal}} +<br /> \mathbf{T}_{\text{normal}\to\text{local}}^T \vec x_{2,\text{local}}<br />
 
I don't understand your answer. Its actualy using quanternions for rotation but i used euler becouse i thought it will be easier. I am really not good at math so if anyone could explain answer or give me example it would be great.
 
I would suggest you try to understand it in small steps.

Step 1: How to build a matrix for a rotation in 2D.
Try to figure out the elements a,b,c,d of a 2x2 matrix, such that
<br /> \left[ \begin{array}{c} x&#039; \\ y&#039; \end{array} \right] =<br /> \left[ \begin{array}{cc} a &amp; b \\ c &amp; d \end{array} \right]<br /> \left[ \begin{array}{c} x \\ y \end{array} \right]<br />
where the vector (x,y) represents a point before the rotation, and the vector (x',y') is the point after being rotated.

Step 2: Now in 3D, build a 3x3 matrix that represent a rotation for one of the Euler angles, that is, around one of the standard axes, either the X-, Y- or Z-axis.

http://en.wikipedia.org/wiki/Rotation_matrix" can help you, and has a lot of examples.

Step 3: Combine (multiply) 3 matrices, 3x3 each, to obtain one matrix that represent the combined rotation for the three Euler angles. Note that the order in which you combine them is important: in your example, when you speak of a rotation of "45,0,0", this is very clear only because there is just one rotation; if you had two or three, you would need to define in which order you perform the rotations.

Now, after Steps 1-3 you know how to get a point in the "normal" coordinate system, and transform it (rotate it) into Cube1's system. But you want the opposite! From Cube1 to the "normal" system. To do that, you use the inverse of that matrix.

What D H was telling you above is that rotation matrices belong to a group of matrices called "orthogonal", which have a very nice property: their inverse is simply the transposed matrix. Just turn rows into columns, and you have the inverse.
 
Last edited by a moderator:

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K