Operators

# quat_compose (Operator)

## Name

quat_compose — Multiply two quaternions.

## Signature

quat_compose( : : QuaternionLeft, QuaternionRight : QuaternionComposed)

## Description

The operator quat_compose multiplies the two quaternions QuaternionLeft and QuaternionRight and returns the result in QuaternionComposed.

A quaternion x is given by x = x_{0} + x_{1}*i + x_{2}*j + x_{3}*k. In HALCON, a quaternion is represented by a four value tuple: [x_{0},x_{1},x_{2},x_{3}].

The product of two quaternions x and y is defined as:

```x*y = (x_{0}*y_{0} - x_{1}*y_{1} - x_{2}*y_{2} - x_{3}*y_{3}) +
(x_{0}*y_{1} + x_{1}*y_{0} + x_{2}*y_{3} - x_{3}*y_{2})*i +
(x_{0}*y_{2} + x_{1}*y_{3} + x_{2}*y_{0} - x_{3}*y_{1})*j +
(x_{0}*y_{3} + x_{1}*y_{2} + x_{2}*y_{1} - x_{3}*y_{0})*k
```

As a consequence, the multiplication of two quaternions is not commutative, i.e. x*y != y*x.

## Parallelization

• Multithreading type: reentrant (runs in parallel with non-exclusive operators).
• Processed without parallelization.

## Parameters

QuaternionLeft (input_control)  quaternion (real)

Left quaternion.

QuaternionRight (input_control)  quaternion (real)

Right quaternion.

QuaternionComposed (output_control)  quaternion (real)

Product of the input quaternions.