Quaternary element and Matrix

Source: Internet
Author: User

The Quaternary element is the simplest super-plural element. For example, a + bi + cj + dk.

Make the p = w1 + x1 * I + y1 * j + z1 * k = w1 + v1 (Real + virtual ).

Set the QQ = w2 + x2 * I + y2 * j + z2 * k = w2 + v2 (real part + virtual part ).


Addition: p + q = (w1 + w2) + (x1 + x2) * I + (y1 + y2) * j + (z1 + z2) * k

Multiplication: p * q = (w1 + (x1 * I + y1 * j + z1 * k )) * (w2 + (x2 * I + y2 * j + z2 * k ))

= W1 * w2-v1. v2 (DOT multiplication) + v1 X v2 (Cross multiplication) + w1 * v2 + w2 * v1

 


Purpose: Replace the rotation matrix.

For example, in 3D ry, if the θ degrees of a particle wound vector (a, B, c) are required to be rotated, the following can be represented by a four-element (x, y, z, w:

Make s = sin (θ/2), c = cos (θ/2)

X = s *,

Y = s * B,

Z = s * c,

W = c

 


Conversion Between the rotation matrix and the Quaternary element:

[W2 + x2-y2-z2, 2xy-2wz, 2xz + 2wy]
[2xy + 2wz, w2-x2-y2-z2, 2yz-2wx]
[2xz-2wy, 2yz + 2wx, w2-x2-y2-z2]

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.