4.7.1.3.1. Displacement

A marker in { } is optional. If the user does not define optional markers, those markers use Ground.InertiaMarker. The user can define a marker name as follows:

(m1,{m2},{m3}) : (bodyname.markername, {bodyname.markername}, {bodyname.markername}).

  • m1 becomes action marker.

  • If m2 is defined, m2 becomes base marker.

  • If m3 is defined, m3 becomes reference marker.

4.7.1.3.1.1. DM

The DM function returns the absolute distance from one marker to the Ground.InertiaMarker or the absolute distance between two markers.

Format

DM(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

\(\text{DM}={{\left( \left[ {{{\vec{R}}}_{\text{mk1}}}-{{{\vec{R}}}_{\text{mk2}}} \right]\cdot \left[ {{{\vec{R}}}_{\text{mk1}}}-{{{\vec{R}}}_{\text{mk2}}} \right]\, \right)}^{1/2}}\)

\({{\vec{R}}_{\text{mk1}}}\): Position vector of Marker1

\({{\vec{R}}_{\text{mk2}}}\): Position vector of Marker2

../_images/image09515.png

Example

DM (body1.Marker1)
DM (body1.Marker1, body2.Marker2)
DM (1, 2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.2. DX

The DX function returns the x-direction location of one marker or the distance between two markers in relation to a third marker’s x-direction.

Format

DX(Marker1{, Marker2}{, Marker3})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Marker3

The name or argument number of the reference marker that serves as the standard for direction
  • If omitted, then the InertiaMarker is applied.

Formulation

\(\text{DX}=\left[ {{{\vec{R}}}_{\text{mk1}}}-{{{\vec{R}}}_{\text{mk2}}} \right]\,\cdot \,{{\hat{x}}_{\text{mk3}}}\)

\({{\vec{R}}_{\text{mk1}}}\): Position vector of Marker1

\({{\vec{R}}_{\text{mk2}}}\): Position vector of Marker2

\({{\hat{x}}_{\text{mk3}}}\): x-direction unit vector of Marker3

../_images/image09714.png

Example

DX(body1.Marker1)
DX(body1.Marker1, body2.Marker1)
DX(body1.Marker1, body2.Marker1, body3.Marker1)
DX(1,2,3) <Argument: (1)body1.Marker1, (2)body2.Marker1, (3)body3.Marker1>

4.7.1.3.1.3. DY

The DY function returns the y-direction location of one marker or the distance between two markers in relation to a third marker’s y-direction.

Format

DY(Marker1{, Marker2}{, Marker3})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Marker3

The name or argument number of the reference marker serves as the standard for direction
  • If omitted, then the InertiaMarker is applied.

Formulation

\(\text{DY}=\left[ {{{\vec{R}}}_{\text{mk1}}}-{{{\vec{R}}}_{\text{mk2}}} \right]\,\cdot {{\hat{y}}_{\text{mk3}}}\)

\({{\vec{R}}_{\text{mk1}}}\): Position vector of Marker1

\({{\vec{R}}_{\text{mk2}}}\): Position vector of Marker2

\({{\hat{y}}_{\text{mk3}}}\): y-direction unit vector of Marker3

../_images/image09914.png

Example

DY(body1.Marker1)
DY(body1.Marker1, body2.Marker1)
DY(body1.Marker1, body2.Marker1, body3.Marker1)
DY(1,2,3) <Argument: (1)body1.Marker1, (2)body2.Marker1, (3)body3.Marker1>

4.7.1.3.1.4. DZ

The DZ function returns the z-direction location of one marker or the distance between two markers in relation to a third marker’s z-direction.

Format

DZ(Marker1{, Marker2}{, Marker3})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Marker3

The name or argument number of the reference marker that serves as the standard for direction
  • If omitted, then the InertiaMarker is applied.

Formulation

\(\text{DZ}=\left[ {{{\vec{R}}}_{\text{mk1}}}-{{{\vec{R}}}_{\text{mk2}}} \right]\,\cdot \,{{\hat{z}}_{\text{mk3}}}\)

\({{\vec{R}}_{\text{mk1}}}\): Position vector of Marker1

\({{\vec{R}}_{\text{mk2}}}\): Position vector of Marker2

\({{\hat{z}}_{\text{mk3}}}\): z-direction unit vector of Marker3

../_images/image10112.png

Example

DZ(body1.Marker1)
DZ(body1.Marker1, body2.Marker1)
DZ(body1.Marker1, body2.Marker1, body3.Marker1)
DZ(1,2,3) <Argument: (1)body1.Marker1, (2)body2.Marker1, (3)body3.Marker1>

4.7.1.3.1.5. AX

The AX function returns the cumulative rotation angle on the x-axis for one marker’s InertiaMarker or the cumulative rotation angle on the x-axis for two markers.

Format

AX(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

\(\text{AX}=ATAN2(-{{\hat{z}}_{\text{mk1}}}\cdot {{\hat{y}}_{\text{mk2}}},{{\hat{z}}_{\text{mk1}}}\cdot {{\hat{z}}_{\text{mk2}}})\)

\({{\hat{y}}_{\text{mk2}}}\): y-direction unit vector of Marker2

\({{\hat{z}}_{\text{mk1}}}\): z-direction unit vector of Marker1

\({{\hat{z}}_{\text{mk2}}}\): z-direction unit vector of Marker2

../_images/image10312.png

Here, ThetaX is utilized to calculate the cumulative rotation angle on the x-axis for two markers.

If x-axis for two markers is deviated, ThetaX becomes inaccurate result.

Example

AX (body1.Marker1)
AX (body1.Marker1, body2.Marker2)
AX (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.6. AY

The AY function returns the cumulative rotation angle on the y-axis for one marker’s InertiaMarker or the cumulative rotation angle on the y-axis for two markers.

Format

AY(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

\(\text{AY}=ATAN2({{\hat{z}}_{\text{mk1}}}\cdot {{\hat{x}}_{\text{mk2}}},{{\hat{z}}_{\text{mk1}}}\cdot {{\hat{z}}_{\text{mk2}}})\)

\({{\hat{z}}_{\text{mk1}}}\): z-direction unit vector of Marker1

\({{\hat{x}}_{\text{mk2}}}\): x-direction unit vector of Marker2

\({{\hat{z}}_{\text{mk2}}}\): z-direction unit vector of Marker2

../_images/image10511.png

Here, ThetaY is utilized to calculate the cumulative rotation angle on the y-axis for two markers.

If y-axis for two markers is deviated, ThetaY becomes inaccurate result.

Example

AY (body1.Marker1)
AY (body1.Marker1, body2.Marker2)
AY (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.7. AZ

The AZ function returns the cumulative rotation angle on the z-axis for one marker’s InertiaMarker or the cumulative rotation angle on the z-axis for two markers.

Format

AZ(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

\(\text{AZ}=ATAN2({{\hat{x}}_{\text{mk1}}}\cdot {{\hat{y}}_{\text{mk2}}},{{\hat{x}}_{\text{mk1}}}\cdot {{\hat{x}}_{\text{mk2}}})\)

\({{\hat{x}}_{\text{mk1}}}\): x-direction unit vector of Marker1

\({{\hat{y}}_{\text{mk2}}}\): y-direction unit vector of Marker2

\({{\hat{x}}_{\text{mk2}}}\): x-direction unit vector of Marker2

../_images/image10715.png

Here, ThetaZ is utilized to calculate the cumulative rotation angle on the z-axis for two markers.

If z-axis for two markers is deviated, ThetaZ becomes inaccurate result.

Example

AZ (body1.Marker1)
AZ (body1.Marker1, body2.Marker2)
AZ (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

Note

The result of ATAN2 as FORTRAN function lies in the range -PI~PI. However, the AX, AY and AZ as expression functions always return an accumulated angle along a rotating direction. The accumulated angle is growing or decaying with the growing time. If the user wants to get a wrapped value by a special angle, use the function expression, MOD’. Please refer to the following Example.

../_images/image10810.png

Figure 4.40 Example of using the AZ function

  • If the user wants to get the result lies in range 0 ~ 360 degree.

    • MOD(AZ(m1,m2),360d) (radian)

    • MOD(AZ(m1,m2),360d)*RTOD (deg)

  • If the user wants to get the result lies in range -180 ~ 180 degree.
    • MOD(AZ(m1,m2),360d)-PI (radian)

    • (MOD(AZ(m1,m2),360d)-PI)*RTOD (deg)

../_images/image10915.png

Figure 4.41 Results of expressions

4.7.1.3.1.8. PSI

The PSI function returns the rotation angle of the first rotation in a z-x-z sequence of Euler angles.

Format

PSI(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

../_images/image11114.png

\(\left[ \begin{matrix} \text{X} \\ \text{Y} \\ \text{Z} \\ \end{matrix} \right]=\left[ \begin{matrix} \cos \text{ }\psi & -\sin \text{ }\psi & 0 \\ \sin \text{ }\psi & \cos \text{ }\psi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} 1 & 0 & 0 \\ 0 & \cos \text{ }\theta & -\sin \text{ }\theta \\ 0 & \sin \text{ }\theta & \cos \text{ }\theta \\ \end{matrix} \right]\left[ \begin{matrix} \cos \text{ }\phi & -\sin \text{ }\phi & 0 \\ \sin \text{ }\phi & \cos \text{ }\phi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} \text{x }\!\!'\!\!\text{ } \\ \text{y }\!\!'\!\!\text{ } \\ \text{z }\!\!'\!\!\text{ } \\ \end{matrix} \right]\)

In line with the sequentially defined rotation order, return rotation angle \(\mathrm{ }\!\!\psi\!\!\text{ }\) on the z-axis, which is the first rotation.

Example

PSI (body1.Marker1)
PSI (body1.Marker1, body2.Marker2)
PSI (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.9. THETA

The THETA function returns the rotation angle of the second rotation in a z-x-z sequence of Euler angles.

Format

THETA(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

../_images/image11313.png

\(\left[ \begin{matrix} \text{X} \\ \text{Y} \\ \text{Z} \\ \end{matrix} \right]=\left[ \begin{matrix} \cos \text{ }\psi & -\sin \text{ }\psi & 0 \\ \sin \text{ }\psi & \cos \text{ }\psi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} 1 & 0 & 0 \\ 0 & \cos \text{ }\theta & -\sin \text{ }\theta \\ 0 & \sin \text{ }\theta & \cos \text{ }\theta \\ \end{matrix} \right]\left[ \begin{matrix} \cos \text{ }\phi & -\sin \text{ }\phi & 0 \\ \sin \text{ }\phi & \cos \text{ }\phi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} \text{x }\!\!'\!\!\text{ } \\ \text{y }\!\!'\!\!\text{ } \\ \text{z }\!\!'\!\!\text{ } \\ \end{matrix} \right]\)

In line with the sequentially defined rotation order, return rotation angle θ on the x-axis, which is the second rotation.

Example

THETA (body1.Marker1)
THETA (body1.Marker1, body2.Marker2)
THETA (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.10. PHI

The PHI function returns the rotation angle of the third rotation in a z-x-z sequence of Euler angles.

Format

PHI(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

../_images/image11512.png

\(\left[ \begin{matrix} \text{X} \\ \text{Y} \\ \text{Z} \\ \end{matrix} \right]=\left[ \begin{matrix} \cos \text{ }\psi & -\sin \text{ }\psi & 0 \\ \sin \text{ }\psi & \cos \text{ }\psi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} 1 & 0 & 0 \\ 0 & \cos \text{ }\theta & -\sin \text{ }\theta \\ 0 & \sin \text{ }\theta & \cos \text{ }\theta \\ \end{matrix} \right]\left[ \begin{matrix} \cos \text{ }\phi & -\sin \text{ }\phi & 0 \\ \sin \text{ }\phi & \cos \text{ }\phi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} \text{x }\!\!'\!\!\text{ } \\ \text{y }\!\!'\!\!\text{ } \\ \text{z }\!\!'\!\!\text{ } \\ \end{matrix} \right]\)

In line with the sequentially defined rotation order, return rotation angle φ on the z-axis, which is the third rotation.

Example

PHI(body1.Marker1)
PHI(body1.Marker1, body2.Marker2)
PHI(1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.11. YAW

The YAW function returns the rotation angle of the first rotation in a z-y-x sequence of Euler angles.

Format

YAW(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

../_images/image1179.png

\(\left[ \begin{matrix} \text{X} \\ \text{Y} \\ \text{Z} \\ \end{matrix} \right]=\left[ \begin{matrix} \cos \text{ }\psi & -\sin \text{ }\psi & 0 \\ \sin \text{ }\psi & \cos \text{ }\psi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} \cos \text{ }\theta & 0 & \sin \text{ }\theta \\ 0 & 1 & 0 \\ -\sin \text{ }\theta & 0 & \cos \text{ }\theta \\ \end{matrix} \right]\left[ \begin{matrix} 1 & 0 & 0 \\ 0 & \cos \text{ }\phi & -\sin \text{ }\phi \\ 0 & \sin \text{ }\phi & \cos \text{ }\phi \\ \end{matrix} \right]\left[ \begin{matrix} \text{x }\!\!'\!\!\text{ } \\ \text{y }\!\!'\!\!\text{ } \\ \text{z }\!\!'\!\!\text{ } \\ \end{matrix} \right]\)

In line with the sequentially defined rotation order, return rotation angle Ψ on the z-axis, which is the first rotation.

Example

YAW (body1.Marker1)
YAW (body1.Marker1, body2.Marker2)
YAW (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.12. PITCH

The PITCH function returns the rotation angle for the second rotation in a z-y-x sequence of Euler angles.

Format

PITCH(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

../_images/image1198.png

\(\left[ \begin{matrix} \text{X} \\ \text{Y} \\ \text{Z} \\ \end{matrix} \right]=\left[ \begin{matrix} \cos \text{ }\psi & -\sin \text{ }\psi & 0 \\ \sin \text{ }\psi & \cos \text{ }\psi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} \cos \text{ }\theta & 0 & \sin \text{ }\theta \\ 0 & 1 & 0 \\ -\sin \text{ }\theta & 0 & \cos \text{ }\theta \\ \end{matrix} \right]\left[ \begin{matrix} 1 & 0 & 0 \\ 0 & \cos \text{ }\phi & -\sin \text{ }\phi \\ 0 & \sin \text{ }\phi & \cos \text{ }\phi \\ \end{matrix} \right]\left[ \begin{matrix} \text{x }\!\!'\!\!\text{ } \\ \text{y }\!\!'\!\!\text{ } \\ \text{z }\!\!'\!\!\text{ } \\ \end{matrix} \right]\)

In line with the sequentially defined rotation order, return rotation angle θ on the y-axis, which is the second rotation.

Example

PITCH (body1.Marker1)
PITCH (body1.Marker1, body2.Marker2)
PITCH (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.13. ROLL

The ROLL function expression calculates the third angle (in radians) of a 3-2-1 Euler rotation sequence between Marker1 and Marker2.

Format

ROLL(Marker1{, Marker2})

Arguments definition

Marker1

The name or argument number of a marker to be calculated

Marker2

The name or argument number of a marker to be calculated
  • If omitted, then the InertiaMarker is applied.

Formulation

../_images/image12112.png

\(\left[ \begin{matrix} \text{X} \\ \text{Y} \\ \text{Z} \\ \end{matrix} \right]=\left[ \begin{matrix} \cos \text{ }\psi & -\sin \text{ }\psi & 0 \\ \sin \text{ }\psi & \cos \text{ }\psi & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]\left[ \begin{matrix} \cos \text{ }\theta & 0 & \sin \text{ }\theta \\ 0 & 1 & 0 \\ -\sin \text{ }\theta & 0 & \cos \text{ }\theta \\ \end{matrix} \right]\left[ \begin{matrix} 1 & 0 & 0 \\ 0 & \cos \text{ }\phi & -\sin \text{ }\phi \\ 0 & \sin \text{ }\phi & \cos \text{ }\phi \\ \end{matrix} \right]\left[ \begin{matrix} \text{x }\!\!'\!\!\text{ } \\ \text{y }\!\!'\!\!\text{ } \\ \text{z }\!\!'\!\!\text{ } \\ \end{matrix} \right]\)

In line with the sequentially defined rotation order, return rotation angle φ on the x-axis, which is the third rotation.

Example

ROLL (body1.Marker1)
ROLL (body1.Marker1, body2.Marker2)
ROLL (1,2) <Argument: (1)body1.Marker1, (2)body2.Marker2 >

4.7.1.3.1.14. INCANG

The INCANG function returns the angle in radians between 2 vectors that are made from the positions of either 3 or 4 markers. If the vectors continue to rotate in the same direction past 180 degrees, then the angle returned increases beyond 180 degrees.

(Note: The initial value of INCANG is between 0 and 180, inclusive)

Format

INCANG(Marker1, Marker2{, Marker3}, Marker4)

Arguments definition

Marker1

The name or argument number of a marker to be calculated. (the end point of the 1st vector)

Marker2

The name or argument number of a marker to be calculated. (the start point of the 1st vector)

Marker3

The name or argument number of a marker to be calculated. (the start point of the 2nd vector)
  • If omitted, then the Marker2 is applied.

Marker4

The name or argument number of a marker to be calculated. (the end point of the 2nd vector)

Formulation

\(\begin{aligned} & \text{Angle} \\ & \theta ={{\cos }^{-1}}\left( \frac{{{{\vec{v}}}_{1}}\cdot {{{\vec{v}}}_{2}}}{\left\| {{{\vec{v}}}_{1}} \right\|\left\| {{{\vec{v}}}_{2}} \right\|} \right) \\ & if,\text{ }\left\| {{{\vec{v}}}_{1}} \right\|<1.e-10\text{ }or\text{ }\left\| {{{\vec{v}}}_{2}} \right\|<1.e-10 \\ & \theta ={{\theta }_{saved}}\text{ }\left( innitial\ {{\theta }_{saved}}=0.0 \right) \\ & \\ & \text{Direction} \\ & {{{\vec{v}}}_{3}}={{{\vec{v}}}_{1}}\times {{{\vec{v}}}_{2}} \\ \end{aligned}\)

../_images/image12310.png

The first value of INCANG is positive angle and the value of INCANG is the cumulative angle on the simulation.

Example

INCANG (body1.Marker1, Ground.InertiaMarker, body2.Marker1)
INCANG (body1.Marker1, body1.Marker2, body2.Marker1, body2.Marker2)
INCANG (1,2,3) <Argument: (1)body1.Marker1, (2)Ground.InertiaMarker, (3)body2.Marker1 >
INCANG (1,2,2,3) <Argument: (1)body1.Marker1, (2)Ground.InertiaMarker, (2)Ground.InertiaMarker, (3)body2.Marker1 >

Note

The Scope Expression created from INCANG expression function does not give the result because it cannot be calculated in GUI.