Difference between revisions of "Homogeneous coordinates"

From Robotics
Jump to: navigation, search
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Navigation|before=[[Rotation]]|overview=[[Transformations]]|next=[[Combinations of transformations]]}}
 
{{Navigation|before=[[Rotation]]|overview=[[Transformations]]|next=[[Combinations of transformations]]}}
  
[[Rotation]] of n-dimensional coordinates can be described by an n-by-n matrix. All the components of the matrix are multiplied with one of the <math>n</math> coordinates. So the transformation is dependent on the original coordinates. Translation however is actually a [[Simple arithmetic operations|vector addition]] and so independent of the original coordinates (see subarticle about [[Translation|translation]]).  
+
In this article three-dimensional space is regarded because it is usually used in robotics. [[Rotation]] of three-dimensional coordinates can be described by a 3-by-3 matrix. All the components of the matrix are multiplied with one of the three coordinates. So the transformation is dependent on the original coordinates. Translation however is actually a [[Simple arithmetic operations|vector addition]] and so independent of the original coordinates (see subarticle about [[Translation|translation]]).  
  
To be able to also apply a translation by [[Multiplication of matrices|matrix multiplication]], an additional dimension is introduced. For three-dimensional space (which is usually regarded in robotics), the homogeneous transformation matrix <math>\mathbf{T}</math> is a 4-by-4 matrix. <math>\mathbf{T}</math> consists of the 3-by-3 rotation matrix <math>\mathbf{R}</math> and a 3-by-1 translation vector <math>\vec{\mathbf{p}}</math> combined with the last row of the identity matrix:<br/>
+
To be able to also apply a translation by [[Multiplication of matrices|matrix multiplication]], an additional dimension is introduced. For vectors, the additional fourth component is always 1. So a three-dimensional vector <math>\vec{\mathbf{q}}</math> in homogeneous coordinates looks as follows: <br/>
 +
:<math>
 +
\vec{\mathbf{q}}=
 +
\left[\begin{array}{c}
 +
q_x\\
 +
q_y\\
 +
q_z\\
 +
1
 +
\end{array}\right]
 +
</math>
 +
 
 +
A homogeneous transformation matrix <math>\mathbf{T}</math> for three-dimensional space is a 4-by-4 matrix. <math>\mathbf{T}</math> consists of a 3-by-3 rotation matrix <math>\mathbf{R}</math> and a 3-by-1 translation vector <math>\vec{\mathbf{p}}</math> combined with the last row of the identity matrix:<br/>
 
:<math>
 
:<math>
 
\mathbf{T}=
 
\mathbf{T}=
Line 11: Line 22:
 
  & & & \\ \hline
 
  & & & \\ \hline
 
0 & 0 & 0 & 1
 
0 & 0 & 0 & 1
\end{array}\right]=
 
\left[\begin{array}{ccc|c}
 
&  &  &  \\
 
\vec{\mathbf{x}} & \vec{\mathbf{y}} & \vec{\mathbf{z}} & \vec{\mathbf{p}}\\
 
& & & \\ \hline
 
0 & 0 & 0 & 1
 
\end{array}\right]=
 
\left[\begin{array}{ccc|c}
 
&  &  &  \mathbf{p}_x\\
 
\vec{\mathbf{x}} & \vec{\mathbf{y}} & \vec{\mathbf{z}} & \mathbf{p}_y\\
 
& & & \mathbf{p}_z\\ \hline
 
0 & 0 & 0 & 1
 
 
\end{array}\right]
 
\end{array}\right]
 
</math>
 
</math>
  
to the standard transformation matrix matrix, where the top left n-by-n submatrix  The additional component of vectors is always a 1. So the multiplication for <math>n=2</math> for example results in:<br/>
+
Let the components of the rotation matrix <math>\mathbf{R}</math> and the translation vector <math>\vec{\mathbf{p}}</math> be denoted as follows:<br/>
 +
:<math>
 +
\mathbf{R}=
 +
\left[\begin{array}{ccc}
 +
r_{11} & r_{12} & r_{13}\\
 +
r_{21} & r_{22} & r_{23}\\
 +
r_{31} & r_{32} & r_{33}
 +
\end{array}\right], \qquad
 +
\vec{\mathbf{p}}=
 +
\left[\begin{array}{c}
 +
p_x\\
 +
p_y\\
 +
p_z
 +
\end{array}\right]
 +
</math>
 +
 
 +
So the multiplication of a homogeneous transformation matrix <math>\mathbf{T}</math> with a vector <math>\vec{\mathbf{q}}_0</math> in homogeneous coordinates leads to:<br/>
 
:<math>
 
:<math>
 +
\vec{\mathbf{q}}_1=
 
\left[\begin{array}{c}
 
\left[\begin{array}{c}
 
x_1\\
 
x_1\\
 
y_1\\
 
y_1\\
 +
z_1\\
 
1
 
1
 
\end{array}\right]=
 
\end{array}\right]=
\mathbf{T} \cdot
+
\mathbf{T} \cdot \vec{\mathbf{q}}_0 =
 +
\left[\begin{array}{cccc}
 +
r_{11} & r_{12} & r_{13} & p_x\\
 +
r_{21} & r_{22} & r_{23} & p_y\\
 +
r_{31} & r_{32} & r_{33} & p_z\\
 +
0 & 0 & 0 & 1
 +
\end{array}\right] \cdot
 
\left[\begin{array}{c}
 
\left[\begin{array}{c}
 
x_0\\
 
x_0\\
 
y_0\\
 
y_0\\
 +
z_0\\
 
1
 
1
 
\end{array}\right]=
 
\end{array}\right]=
\left[\begin{array}{ccc}
 
t_{11} & t_{12} & t_{13}\\
 
t_{21} & t_{22} & t_{23}\\
 
0 & 0 & 1
 
\end{array}\right]
 
\cdot
 
 
\left[\begin{array}{c}
 
\left[\begin{array}{c}
x_0\\
+
r_{11}\cdot x_0+r_{12}\cdot y_0+r_{13}\cdot z_0+\mathbf{p_x}\\
y_0\\
+
r_{21}\cdot x_0+r_{22}\cdot y_0+r_{23}\cdot z_0+\mathbf{p_y}\\
1
+
r_{31}\cdot x_0+r_{32}\cdot y_0+r_{33}\cdot z_0+\mathbf{p_z}\\
\end{array}\right]=
 
\left[\begin{array}{c}
 
t_{11}\cdot x_0+t_{12}\cdot y_0+t_{13}\cdot 1\\
 
t_{21}\cdot x_0+t_{22}\cdot y_0+t_{23}\cdot 1\\
 
0\cdot x_0+0\cdot y_0+1\cdot1
 
\end{array}\right]=
 
\left[\begin{array}{c}
 
t_{11}\cdot x_0+t_{12}\cdot y_0+{\color{Green}\mathbf{t_{13}}}\\
 
t_{21}\cdot x_0+t_{22}\cdot y_0+{\color{Green}\mathbf{t_{23}}}\\
 
 
1
 
1
 
\end{array}\right]
 
\end{array}\right]
 
</math>  
 
</math>  
  
As can be seen in the resulting vector, the components <math>t_{13}</math> and <math>t_{23}</math> are independent of the original coordinates and just added to the x- or the y-coordinate, respectively.
+
As can be seen in the resulting vector, the first 3 summands of each component belong to the rotational part while the components of the translation vector are added independently of the previous coordinates. So in homogeneous coordinates rotation and translation can be performed with a single transformation matrix. The rotation is applied first and then the translation vector is added. Regarding the particular transformations multiplication with a homogeneous transformation matrix is equivalent in cartesian coordinates to multiplication of the input vector by <math>\mathbf{R}</math> and then adding the translation vector:<br/>
 +
:<math>
 +
\vec{\mathbf{q}}_1=
 +
\mathbf{T} \cdot \vec{\mathbf{q}}_0 \equiv
 +
\mathbf{R}\cdot \vec{\mathbf{q}}_0 + \vec{\mathbf{p}}
 +
</math>  
 +
 
 +
Transformations are applied to one coordinate frame with respect to another certain reference frame. The following notation is used to determine the transformation of the coordinate frame <math>N</math> with respect to the reference frame <math>R</math>:
 +
:<math>
 +
^R\mathbf{T}_N
 +
</math>
 +
 
 +
More information about the [[Combinations of transformations|combination of transformations]] and about their order is provided in the following subarticle.
 +
 
 +
A simple three-dimensional translation in homogeneous coordinates is denoted as follows:<br/>
 +
:<math>
 +
\mathbf{Trans}(p_x,p_y,p_z)=
 +
\left[\begin{array}{cccc}
 +
1 & 0 & 0 & p_x\\
 +
0 & 1 & 0 & p_y\\
 +
0 & 0 & 1 & p_z\\
 +
0 & 0 & 0 & 1
 +
\end{array}\right]
 +
</math>
 +
The matrices introduced for [[Rotation|rotation]] are the following in homogeneous coordinates:<br/>
 +
:<math>
 +
\mathbf{Rot}(x,\varphi)=
 +
\left[\begin{array}{cccc}
 +
1 & 0 & 0 & 0\\
 +
0 & \cos\varphi & -\sin\varphi & 0\\
 +
0 & \sin\varphi & \cos\varphi & 0\\
 +
0 & 0 & 0 & 1
 +
\end{array}\right]
 +
</math><br/><br/>
 +
:<math>
 +
\mathbf{Rot}(y,\varphi)=
 +
\left[\begin{array}{cccc}
 +
\cos\varphi & 0 & \sin\varphi & 0\\
 +
0 & 1 & 0 & 0\\
 +
-\sin\varphi & 0 & \cos\varphi & 0\\
 +
0 & 0 & 0 & 1
 +
\end{array}\right]
 +
</math><br/><br/>
 +
:<math>
 +
\mathbf{Rot}(z,\varphi)=
 +
\left[\begin{array}{cccc}
 +
\cos\varphi & -\sin\varphi & 0 & 0\\
 +
\sin\varphi & \cos\varphi & 0 & 0\\
 +
0 & 0 & 1 & 0\\
 +
0 & 0 & 0 & 1
 +
\end{array}\right]
 +
</math>
 +
 
 +
 
  
 
[[Category:Article]]
 
[[Category:Article]]
 
[[Category:Transformations]]
 
[[Category:Transformations]]

Latest revision as of 16:36, 23 October 2015

← Back: Rotation Overview: Transformations Next: Combinations of transformations

In this article three-dimensional space is regarded because it is usually used in robotics. Rotation of three-dimensional coordinates can be described by a 3-by-3 matrix. All the components of the matrix are multiplied with one of the three coordinates. So the transformation is dependent on the original coordinates. Translation however is actually a vector addition and so independent of the original coordinates (see subarticle about translation).

To be able to also apply a translation by matrix multiplication, an additional dimension is introduced. For vectors, the additional fourth component is always 1. So a three-dimensional vector \vec{\mathbf{q}} in homogeneous coordinates looks as follows:


\vec{\mathbf{q}}=
\left[\begin{array}{c}
q_x\\ 
q_y\\
q_z\\
1
\end{array}\right]

A homogeneous transformation matrix \mathbf{T} for three-dimensional space is a 4-by-4 matrix. \mathbf{T} consists of a 3-by-3 rotation matrix \mathbf{R} and a 3-by-1 translation vector \vec{\mathbf{p}} combined with the last row of the identity matrix:


\mathbf{T}=
\left[\begin{array}{ccc|c}
 &  &  &  \\ 
 & \mathbf{R} &  & \vec{\mathbf{p}}\\
 & & & \\ \hline
0 & 0 & 0 & 1
\end{array}\right]

Let the components of the rotation matrix \mathbf{R} and the translation vector \vec{\mathbf{p}} be denoted as follows:


\mathbf{R}=
\left[\begin{array}{ccc}
r_{11} & r_{12} & r_{13}\\
r_{21} & r_{22} & r_{23}\\
r_{31} & r_{32} & r_{33}
\end{array}\right], \qquad
\vec{\mathbf{p}}=
\left[\begin{array}{c}
p_x\\
p_y\\
p_z
\end{array}\right]

So the multiplication of a homogeneous transformation matrix \mathbf{T} with a vector \vec{\mathbf{q}}_0 in homogeneous coordinates leads to:


\vec{\mathbf{q}}_1=
\left[\begin{array}{c}
x_1\\
y_1\\
z_1\\
1
\end{array}\right]=
\mathbf{T} \cdot \vec{\mathbf{q}}_0 =
\left[\begin{array}{cccc}
r_{11} & r_{12} & r_{13} & p_x\\
r_{21} & r_{22} & r_{23} & p_y\\
r_{31} & r_{32} & r_{33} & p_z\\
0 & 0 & 0 & 1
\end{array}\right] \cdot
\left[\begin{array}{c}
x_0\\
y_0\\
z_0\\
1
\end{array}\right]=
\left[\begin{array}{c}
r_{11}\cdot x_0+r_{12}\cdot y_0+r_{13}\cdot z_0+\mathbf{p_x}\\
r_{21}\cdot x_0+r_{22}\cdot y_0+r_{23}\cdot z_0+\mathbf{p_y}\\
r_{31}\cdot x_0+r_{32}\cdot y_0+r_{33}\cdot z_0+\mathbf{p_z}\\
1
\end{array}\right]

As can be seen in the resulting vector, the first 3 summands of each component belong to the rotational part while the components of the translation vector are added independently of the previous coordinates. So in homogeneous coordinates rotation and translation can be performed with a single transformation matrix. The rotation is applied first and then the translation vector is added. Regarding the particular transformations multiplication with a homogeneous transformation matrix is equivalent in cartesian coordinates to multiplication of the input vector by \mathbf{R} and then adding the translation vector:


\vec{\mathbf{q}}_1=
\mathbf{T} \cdot \vec{\mathbf{q}}_0 \equiv
\mathbf{R}\cdot \vec{\mathbf{q}}_0 + \vec{\mathbf{p}}

Transformations are applied to one coordinate frame with respect to another certain reference frame. The following notation is used to determine the transformation of the coordinate frame N with respect to the reference frame R:


^R\mathbf{T}_N

More information about the combination of transformations and about their order is provided in the following subarticle.

A simple three-dimensional translation in homogeneous coordinates is denoted as follows:

 
\mathbf{Trans}(p_x,p_y,p_z)=
\left[\begin{array}{cccc}
1 & 0 & 0 & p_x\\
0 & 1 & 0 & p_y\\
0 & 0 & 1 & p_z\\
0 & 0 & 0 & 1
\end{array}\right]

The matrices introduced for rotation are the following in homogeneous coordinates:

 
\mathbf{Rot}(x,\varphi)=
\left[\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & \cos\varphi & -\sin\varphi & 0\\
0 & \sin\varphi & \cos\varphi & 0\\
0 & 0 & 0 & 1
\end{array}\right]

 
\mathbf{Rot}(y,\varphi)=
\left[\begin{array}{cccc}
\cos\varphi & 0 & \sin\varphi & 0\\
0 & 1 & 0 & 0\\
-\sin\varphi & 0 & \cos\varphi & 0\\
0 & 0 & 0 & 1
\end{array}\right]

 
\mathbf{Rot}(z,\varphi)=
\left[\begin{array}{cccc}
\cos\varphi & -\sin\varphi & 0 & 0\\
\sin\varphi & \cos\varphi & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1
\end{array}\right]