Translation using rotation matrix

In summary: That is one of the reasons why it is called a "transformation matrix".So, if you want to translate 1 unit along the z axis, you would use a matrix like this:$$\begin{bmatrix}1 & 0 & 0 & 0 \\0 & 1 & 0 & 0 \\0 & 0 & 1 & 1 \\0 & 0 & 0 & 1 \end{bmatrix}$$To translate 1 unit along the x axis would look like this:$$\begin{bmatrix}1 & 0 & 0 & 1 \\0 & 1 & 0 & 0 \\0 & 0 &
  • #1
laurah
2
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
  • #2
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).
 
  • #3
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.
 
  • #4
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.
 
  • #5


Dear researcher,

Thank you for your question. To calculate the coordinates of an object after a translation using a rotation matrix, you can use the following formula:

(x', y', z') = (r11*x0 + r12*y0 + r13*z0 + tx, r21*x0 + r22*y0 + r23*z0 + ty, r31*x0 + r32*y0 + r33*z0 + tz)

Where x', y', and z' are the new coordinates of the object, r11, r12, r13, r21, r22, r23, r31, r32, and r33 are the elements of the rotation matrix, and tx, ty, and tz are the translation values. In your case, tx would be 3 units, ty would be 0 units, and tz would be -2 units.

This formula works by first rotating the starting coordinates (x0, y0, z0) using the rotation matrix, and then adding the translation values to the rotated coordinates to get the final coordinates (x', y', z'). This can be extended to any translation and rotation combination.

I hope this helps with your calculations. If you have any further questions, please don't hesitate to ask.

Best regards,
 

1. What is a rotation matrix?

A rotation matrix is a mathematical tool used to represent and perform rotations in three-dimensional space. It is a square matrix with special properties that allow it to rotate a vector or a point in space around a fixed point or axis.

2. How is a rotation matrix used in translation?

In translation, a rotation matrix is used to transform a point or a vector from one coordinate system to another. It is typically used in computer graphics and robotics to rotate and translate objects in three-dimensional space.

3. What is the difference between a rotation matrix and a translation matrix?

A rotation matrix only performs rotations, while a translation matrix only performs translations. However, they can be combined to perform both rotation and translation in a single transformation.

4. How is a rotation matrix calculated?

A rotation matrix can be calculated using various methods, such as using the Euler angles, axis-angle representation, or quaternions. The most common method involves using trigonometric functions to calculate the entries of the matrix based on the rotation angle and axis.

5. What are some practical applications of translation using rotation matrix?

Translation using rotation matrix has numerous practical applications, including computer graphics, robotics, animation, and navigation systems. It is also used in physics and engineering to model and analyze rotational motion and rigid bodies.

Similar threads

Replies
18
Views
1K
  • Linear and Abstract Algebra
Replies
6
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
975
Replies
2
Views
16K
  • Differential Geometry
Replies
4
Views
12K
  • Linear and Abstract Algebra
Replies
5
Views
12K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Linear and Abstract Algebra
Replies
6
Views
2K
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
5
Views
1K
Back
Top