13. Localization system

The localization system category contains only localizationSystem elements. A localization system is an HDF5 named group child of /localizationSystem with two attributes :

  • reference is an HDF5 string attribute and is optional. It represents the reference localization system (an absolute localization system has no reference).

  • dimension is an HDF5 integer attribute and is mandatory. It represents the dimension of the system.

data.h5
`-- localizationSystem/
    |-- $locsys[@dimension=3]
    `-- $locsys1[@dimension=3
                 @reference=/localizationSystem/$locsys]

A localization system comprises elementary geometric transformations, a transformation can be :

  • Scale transformation

  • Rotation

  • Translation

These elementary transformations are the children of a localization system and have a string attribute type equals scale, rotation, translation or zxzEulerRotation.

Example :

data.h5
`-- localizationSystem/
    |-- $locsys[@dimension=3]/
    `-- $locsys1[@dimension=3
                 @reference=/localizationSystem/$locsys1]/

Note

If a localization system has no transformations child, it is equivalent to the reference localization system.

Each transformation moves, rotates or scales the localization relative to the reference localization system in sequence.

13.1. Transformation order

Transformations have to be ordered to give the correct result. The order is stored in a mandatory attribute rank owned by all transformations.

data.h5
`-- localizationSystem/
    `-- $locsys[@dimension=3]/
        |-- $scale1[@type=scale
        |           @rank=2]
        |-- $rotation1[@type=rotation
        |              @rank=1]
        `-- $translation1[@type=translation
                          @$rank=3]

Transformations will then be applied in the following order :

1

$rotation1

2

$scale1

3

$translation1

13.2. Scale transformation

A scale transformation is simply a scale factor, it is a HDF5 named floatingType equals dataSet of one float element with type equals scale.

Example :

data.h5
`-- localizationSystem/
    `-- $locsys[@dimension=3]/
        `-- $scale1[@type=scale]

where data.h5:/localizationSystem/$locsys/$scale1 :

\[\begin{split}\begin{pmatrix} 2.0 \\ \end{pmatrix}\end{split}\]

13.3. Rotation

A rotation is defined by a 3x3 matrix :

\[\begin{split}A = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix}\end{split}\]

The point coodinates are calculated with :

\[\begin{split}\begin{pmatrix}x_1' \\ y_1' \\ z_1'\end{pmatrix} = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix} \begin{pmatrix}x_1 \\ y_1 \\ z_1\end{pmatrix}\end{split}\]

Example of a rotation of \(\alpha\) around the x axis :

\[\begin{split}R_x(\alpha) = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos\alpha & \sin\alpha \\ 0 & -\sin\alpha & \cos\alpha \end{pmatrix}\end{split}\]

In Amelet HDF, a rotation is a HDF5 named floatingType equals dataSet of 3x3 floats elements with type equals rotation.

Example :

data.h5
`-- localizationSystem/
    `-- $locsys[@dimension=3]/
        `-- $rotation1[@type=rotation]

where data.h5:/localizationSystem/$locsys/$rotation1 :

\[\begin{split}\begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos\alpha & \sin\alpha \\ 0 & -\sin\alpha & \cos\alpha \end{pmatrix}\end{split}\]

13.4. Euler rotation

Rotation can be expressed with the zxz Euler convention.

Three consecutive rotations \(D, C, B\) are applied :

  • A rotation around the Z axis, angle \(\phi\)

  • A rotation around the X axis , angle \(\theta \in [0, \pi]\)

  • A rotation around the z axis, angle \(\psi\)

_images/euler_rotation.png
\[\begin{split}D = \begin{pmatrix} \cos\phi & \sin\phi & 0 \\ -\sin\phi & \cos\phi & 0 \\ 0 & 0 & 1 \end{pmatrix}\end{split}\]
\[\begin{split}C = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos\theta & \sin\theta \\ 0 & -\sin\theta & \cos\theta \end{pmatrix}\end{split}\]
\[\begin{split}B = \begin{pmatrix} \cos\psi & \sin\psi & 0 \\ -\sin\psi & \cos\psi & 0 \\ 0 & 0 & 1 \end{pmatrix}\end{split}\]

And finaly the resultant matrix \(A = BCD\)

In Amelet HDF, an Euler rotation is a HDF5 named floatingType equals vector of 3 floats elements \((\phi, \theta, \psi)\) with type equals zxzEulerRotation.

Example :

data.h5
`-- localizationSystem/
    `-- $locsys[@dimension=3]/
        `-- $euler1[@type=zxzEulerRotation]

where data.h5:/localizationSystem/$locsys/$euler1 :

\[\begin{split}\begin{pmatrix} \pi & \pi/2 & \pi \\ \end{pmatrix}\end{split}\]

13.5. Translation

A translation is defined by a vector \(T(T_x, T_y, T_z)\).

In Amelet HDF, a translation is a HDF5 named floatingType equals vector of 3 floats elements with type equals translation.

Example :

data.h5
`-- localizationSystem/
    `-- $locsys[@dimension=3]/
        `-- $translation1[@type=translation]

where data.h5:/localizationSystem/$locsys/$translation1 :

\[\begin{split}\begin{pmatrix} 1 & 0 & 0 \\ \end{pmatrix}\end{split}\]