Quaternion Multiplication

Calculate product of two quaternions

• Library:
• Aerospace Blockset / Utilities / Math Operations

Description

The Quaternion Multiplication block calculates the product for two given quaternions. Aerospace Blockset™ uses quaternions that are defined using the scalar-first convention. For more information on the quaternion forms, see Algorithms.

Ports

Input

expand all

First quaternion, specified as a vector or vector of quaternions. A vector of quaternions has this form, where q and p are quaternions:

```[ q 0 , p 0 , ..., q 1 , p 1 , ... , q 2 , p 2 , ... , q 3 , p 3 , ...]```

Data Types: `double`

Second quaternion, specified as a vector or vector of quaternions. A vector of quaternions has this form, where s and r are quaternions:

```[ s 0 , r 0 , ..., s 1 , r 1 , ... , s 2 , r 2 , ... , s 3 , r 3 , ...]```

Data Types: `double`

Output

expand all

Product of two quaternions, output as a vector or vector of quaternion products.

Data Types: `double`

Algorithms

This block uses quaternions of the form of

`$q={q}_{0}+i{q}_{1}+j{q}_{2}+k{q}_{3}$`

and

`$r={r}_{0}+i{r}_{1}+j{r}_{2}+k{r}_{3}.$`

The quaternion product has the form of

`$t=q×r={t}_{0}+i{t}_{1}+j{t}_{2}+k{t}_{3},$`

where

`$\begin{array}{l}{t}_{0}=\left({r}_{0}{q}_{0}-{r}_{1}{q}_{1}-{r}_{2}{q}_{2}-{r}_{3}{q}_{3}\right)\\ {t}_{1}=\left({r}_{0}{q}_{1}+{r}_{1}{q}_{0}-{r}_{2}{q}_{3}+{r}_{3}{q}_{2}\right)\\ {t}_{2}=\left({r}_{0}{q}_{2}+{r}_{1}{q}_{3}+{r}_{2}{q}_{0}-{r}_{3}{q}_{1}\right)\\ {t}_{3}=\left({r}_{0}{q}_{3}-{r}_{1}{q}_{2}+{r}_{2}{q}_{1}+{r}_{3}{q}_{0}\right)\end{array}$`

References

[1] Stevens, Brian L., Frank L. Lewis. Aircraft Control and Simulation, Second Edition. Hoboken, NJ: Wiley–Interscience.

Version History

Introduced before R2006a
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 4, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9666663408279419, "perplexity": 7483.558951609529}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103619185.32/warc/CC-MAIN-20220628233925-20220629023925-00021.warc.gz"}