Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Quaternion point rotation

`rotationResult = rotatepoint(quat,cartesianPoints)`

rotates the Cartesian points using the quaternion, `rotationResult`

= rotatepoint(`quat`

,`cartesianPoints`

)`quat`

. The
elements of the quaternion are normalized before use in the rotation.

Quaternion point rotation rotates a point specified in **R**^{3} according to a specified
quaternion:

$${L}_{q}(u)=qu{q}^{*}$$

where *q* is the quaternion, *** represents
conjugation, and *u* is the point to rotate, specified as a quaternion.

For convenience, the `rotatepoint`

function takes in a point in **R**^{3} and returns a point in **R**^{3}. Given a function call with
some arbitrary quaternion, *q* = *a* + *b*i +
*c*j + *d*k, and arbitrary coordinate, [*x*,*y*,*z*], for
example,

rereferencedPoint = rotatepoint(q,[x,y,z])

`rotatepoint`

function performs the following operations:
Converts point [

*x*,*y*,*z*] to a quaternion:$${u}_{q}=0+xi+yj+zk$$

Normalizes the quaternion,

*q*:$${q}_{n}=\frac{q}{\sqrt{{a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}}}$$

Applies the rotation:

$${v}_{q}=q{u}_{q}{q}^{*}$$

Converts the quaternion output,

*v*, back to_{q}**R**^{3}