Translation using rotation matrix

Click For Summary

Discussion Overview

The discussion focuses on calculating the coordinates of an object in 3D space after applying a translation and rotation using a rotation matrix. Participants explore the application of linear algebra concepts, particularly in the context of computer graphics and transformations involving homogeneous coordinates.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant seeks to calculate new coordinates after translating an object 3 units forward and 2 units downward, using a given rotation matrix and starting coordinates.
  • Another participant explains the use of a transformation matrix in homogeneous coordinates to combine rotation and translation, providing a matrix representation for the transformation.
  • There is a discussion about multiplying transformation matrices to achieve the desired coordinates, with emphasis on obtaining a 4-dimensional vector from the multiplication.
  • A participant expresses success in calculating coordinates for the forward translation but encounters difficulty when adding a z component, noting that the z translation appears dependent on the object's facing direction.
  • Another participant points out the importance of the order of matrix multiplication, suggesting that left-multiplying and right-multiplying matrices affects the outcome of the transformations.

Areas of Agreement / Disagreement

Participants generally agree on the use of transformation matrices and the process of matrix multiplication, but there is disagreement regarding the correct application of translations in relation to the object's orientation, leading to unresolved questions about the z component's dependency on direction.

Contextual Notes

Participants mention the need for clarity on the order of matrix multiplication and how it affects the transformations, indicating potential limitations in understanding the implications of left versus right multiplication in this context.

laurah
Messages
2
Reaction score
0
Hi, I want to calculate the coordinates of an object after a particular translation.

I have the 3D coordinates at the origin: x0,y0,z0
and i have the 3x3 rotation matrix: (r11, r12, r13; r21, r22, r23; r31, r32, r33)

If I want to move 3 units forward, in the direction i am facing and two units directly downwards with the z plane, how would I do this using my starting coords and the rotation matrix?

If it matters, the reason why I want to do this is that I have a magnetic tracker (minibird) and I have the sensor mounted on an object - I want to be able to calculate the coordinates of the edges of the object.

I know this is a trivial question, but I am not having much luck with my limited linear algebra knowledge...

Many thanks for any help.
 
Physics news on Phys.org
laurah said:
Hi, I want to calculate the coordinates of an object after a particular translation.

I have the 3D coordinates at the origin: x0,y0,z0
and i have the 3x3 rotation matrix: (r11, r12, r13; r21, r22, r23; r31, r32, r33)

If I want to move 3 units forward, in the direction i am facing and two units directly downwards with the z plane, how would I do this using my starting coords and the rotation matrix?

If it matters, the reason why I want to do this is that I have a magnetic tracker (minibird) and I have the sensor mounted on an object - I want to be able to calculate the coordinates of the edges of the object.

I know this is a trivial question, but I am not having much luck with my limited linear algebra knowledge...

Many thanks for any help.

Welcome to PF, laurah! :smile:

In computer graphics, usually a transformation matrix of so called homogeneous coordinates is used.

In your case the original transformation matrix is:
$$\begin{bmatrix}
r11 & r12 & r13 & x0 \\
r21 & r22 & r23 & y0 \\
r31 & r32 & r33 & z0 \\
0 & 0 & 0 & 1 \end{bmatrix}$$
This represents a rotation combined with a translation over (x0,y0,z0).

A move of 3 units in the relative x direction is:
$$\begin{bmatrix}
1 & 0 & 0 & 3 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 \end{bmatrix}$$

Multiply the matrices to get the result.

To calculate regular coordinates from it, multiply the transformation matrix with a point for which you want to find the relative position.
The result is a 4-dimensional vector like (x,y,z,w).
This vector corresponds to the point (x/w,y/w,z/w).
 
I like Serena said:
Welcome to PF, laurah! :smile:

In computer graphics, usually a transformation matrix of so called homogeneous coordinates is used.

In your case the original transformation matrix is:
$$\begin{bmatrix}
r11 & r12 & r13 & x0 \\
r21 & r22 & r23 & y0 \\
r31 & r32 & r33 & z0 \\
0 & 0 & 0 & 1 \end{bmatrix}$$
This represents a rotation combined with a translation over (x0,y0,z0).

A move of 3 units in the relative x direction is:
$$\begin{bmatrix}
1 & 0 & 0 & 3 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 \end{bmatrix}$$

Multiply the matrices to get the result.

To calculate regular coordinates from it, multiply the transformation matrix with a point for which you want to find the relative position.
The result is a 4-dimensional vector like (x,y,z,w).
This vector corresponds to the point (x/w,y/w,z/w).


Thank you very much for your reply, I really appreciate it! :smile:


So with your advice, I am doing the following:

$$\begin{bmatrix}
r11 & r12 & r13 & x0 \\
r21 & r22 & r23 & y0 \\
r31 & r32 & r33 & z0 \\
0 & 0 & 0 & 1 \end{bmatrix}$$

multiplied by

$$\begin{bmatrix}
1 & 0 & 0 & 3 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 \end{bmatrix}$$


and then i am taking the 4th column of the result, and dividing the first three rows of that column by the number in the 4th row of that column.

This seems to give me the correct x,y,z coordinates for 3 units in front. Thanks!

However, I am running into trouble when I add a z component, i.e.

$$\begin{bmatrix}
1 & 0 & 0 & 3 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 1 \\
0 & 0 & 0 & 1 \end{bmatrix}$$

The z component seems to be dependent on the direction the object is facing.

e.g. if my axes are defined as: X is north-south, Y is east-west, Z is up-down,
- when my object faces east, the z translation is positive and when my object faces west, the z translation is negative.

Sorry, this is really elementary stuff, but I feel quite stumped. :frown:

Thanks again for your assistance.
 
It matters if you left-multiply the matrix or right-multiply.
If I understand you correctly you want to left multiply with a matrix that translates in the z direction, and you want to right-multiply with a matrix that translates in the x direction.

Effectively you would pick a point in front of your minibird, then rotate, and then translate in the z direction.
 

Similar threads

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