urx.transform - moduleus/urx GitHub Wiki

3D transformation made of a rotation and a translation.

Parameters

Parameter Datatype Description
translation vector3d Translation operation $(d_x, d_y, d_z)$, in [m], in a 3D Cartesian system.
rotation vector3d Rotation operation $(\alpha, \beta, \gamma)$, in [radian], in a 3D Cartesian system, using the right-hand rule.

Notes

When applying a transform to a coordinate system, the rotation is applied first, then the translation.

Translation

Let $(d_x, d_y, d_z)$ be the translation along the axis $x, y, z$. The translation matrix $D$ is:

$$ D(d_x, d_y, d_z) = \begin{bmatrix} 1 & 0 & 0 & d_x\ 0 & 1 & 0 & d_y\ 0 & 0 & 1 & d_z\ 0 & 0 & 0 & 1 \end{bmatrix} $$

Rotation

Let $\alpha, \beta, \gamma$ be the angles of rotation (in radians) around the $x, y, z$ axis respectively. The following figure shows the positive direction of rotation for each axis:

transform_rotation_right_hand.drawio.svg

The global rotation $R$ is the composition of the rotation $R_x(\alpha)$ then $R_y(\beta)$ then $R_z(\gamma)$:

$$ {\displaystyle {\begin{aligned}\ R(\alpha, \beta, \gamma)=R_{z}(\gamma ) \circ R_{y}(\beta ) \circ R_{x}(\alpha )&= {\begin{bmatrix} \cos \gamma &-\sin \gamma & 0 & 0\ \sin \gamma &\cos \gamma & 0 & 0\ 0 & 0 & 1 & 0\ 0 & 0 & 0 & 1\ \end{bmatrix}} {\begin{bmatrix} \cos \beta &0&\sin \beta & 0\ 0 & 1 & 0 & 0\ -\sin \beta &0&\cos \beta & 0\ 0 & 0 & 0 & 1\ \end{bmatrix}} {\begin{bmatrix} 1 & 0 & 0 & 0\ 0&\cos \alpha &-\sin \alpha & 0\ 0&\sin \alpha &\cos \alpha & 0\ 0 & 0 & 0 & 1\ \end{bmatrix}} \&= {\begin{bmatrix} \cos \beta \cos \gamma &\sin \alpha \sin \beta \cos \gamma -\cos \alpha \sin \gamma &\cos \alpha \sin \beta \cos \gamma +\sin \alpha \sin \gamma &0\ \cos \beta \sin \gamma &\sin \alpha \sin \beta \sin \gamma +\cos \alpha \cos \gamma &\cos \alpha \sin \beta \sin \gamma -\sin \alpha \cos \gamma &0\ -\sin \beta &\sin \alpha \cos \beta &\cos \alpha \cos \beta & 0\ 0 & 0 & 0 & 1\ \end{bmatrix}} \end{aligned}}} $$

Transform

The transform operation $T$ is defined by:

$$ T = R(\alpha, \beta, \gamma) \circ D(d_x, d_y, d_z) = \begin{bmatrix} \cos \beta \cos \gamma &\sin \alpha \sin \beta \cos \gamma -\cos \alpha \sin \gamma &\cos \alpha \sin \beta \cos \gamma +\sin \alpha \sin \gamma & d_x\ \cos \beta \sin \gamma &\sin \alpha \sin \beta \sin \gamma +\cos \alpha \cos \gamma &\cos \alpha \sin \beta \sin \gamma -\sin \alpha \cos \gamma &d_y\ -\sin \beta &\sin \alpha \cos \beta &\cos \alpha \cos \beta & d_z\ 0 & 0 & 0 & 1\ \end{bmatrix} $$

See Also

element | probe | receive_setup | rotation | translation | transmit_setup

Rotation matrix - Wikipedia