Rigid Transformation Math: Difference between revisions

From FreeCAD Documentation
(Created page with "''This page is under construction. Test LaTex capability'' Rotations can be represented as orthogonal 3 x 3 matrices. Acting on a position vector they generate the rotated c...")
 
(First cut)
Line 1: Line 1:
''This page is under construction. Test LaTex capability''
''This page is under construction. Test LaTex capability''
Rotations can be represented as orthogonal 3 x 3 matrices. Acting on a position vector they generate the rotated coordinates by <math display ="inline"> x^\prime = Rx</math>
Rotations can be represented as orthogonal 3 x 3 matrices. Acting on a position vector they generate the rotated coordinates by <math display ="inline"> x^\prime = Rx</math>. Rotations keep the origin fixed. A general (proper) rigid motion combines a rotation with a translation <math display ="inline"> x^\prime = x + a</math>, that is <math display ="inline"> x^\prime = Rx + a</math>. (A proper rigid motion is one that preserves lengths and angles, but excludes reflections. A FreeCAD placement is such.)

There is a very useful representation, used by FreeCAD's ''Placement'', of these proper rigid motions by 4 x 4 matrices of the special form
<math>
\begin{pmatrix}
R & a \\
0 & 1
\end{pmatrix}
</math>.
The rigid motion <math display ="inline"> x^\prime = x + a</math> then takes the matrix form
<math>
\begin{pmatrix}
x^\prime \\
0
\end{pmatrix}
=
\begin{pmatrix}
R & a \\
0 & 1
\end{pmatrix}
\begin{pmatrix}
x \\
0
\end{pmatrix}
</math>.
In this compact notation, R is the 3 by 3 rotation matrix, and <math> a</math>, <math> x</math> and <math> x^\prime</math> are 3 by 1 column position vectors. In FreeCAD we can construct the Placement from its constituent Rotation and displacement.

<pre>
R = App.Rotation(App.Vector(0,0,1), 120) # 120 degree rotation about z-axis
a = App.Vector(10,0,0) # displacement of 10 along x axis
pl = App.Placement(a, R) # construct placement, can retrieve a as pl.Base, R as pl.Rotation
</pre>

In terms of the matrices, we can decompose the general transformation into its constituent translation and rotation.
<math>
\begin{pmatrix}
R &a \\
0 &1
\end{pmatrix}
=
\begin{pmatrix}
I & a \\
0 & 1
\end{pmatrix}
\begin{pmatrix}
R & o \\
0 & 1
\end{pmatrix}
</math>, where <math> I</math> is the Identity matrix and <math>o</math> is the 0-vector. Note that in terms of operations, we read the matrices from right to left, i. e. we first rotate, then we translate <math display =inline> x\rightarrow Rx\rightarrow Rx + a</math>

Revision as of 20:14, 23 December 2021

This page is under construction. Test LaTex capability

Rotations can be represented as orthogonal 3 x 3 matrices. Acting on a position vector they generate the rotated coordinates by . Rotations keep the origin fixed. A general (proper) rigid motion combines a rotation with a translation , that is . (A proper rigid motion is one that preserves lengths and angles, but excludes reflections. A FreeCAD placement is such.)

There is a very useful representation, used by FreeCAD's Placement, of these proper rigid motions by 4 x 4 matrices of the special form . The rigid motion then takes the matrix form . In this compact notation, R is the 3 by 3 rotation matrix, and , and are 3 by 1 column position vectors. In FreeCAD we can construct the Placement from its constituent Rotation and displacement.

R = App.Rotation(App.Vector(0,0,1), 120) # 120 degree rotation about z-axis
a = App.Vector(10,0,0) # displacement of 10 along x axis
pl = App.Placement(a, R) # construct placement, can retrieve a as pl.Base, R as pl.Rotation

In terms of the matrices, we can decompose the general transformation into its constituent translation and rotation. , where is the Identity matrix and is the 0-vector. Note that in terms of operations, we read the matrices from right to left, i. e. we first rotate, then we translate