# Quaternion Interpolation

Quaternion interpolation between two quaternions

## Library

Utilities/Math Operations

## Description

The Quaternion Interpolation block calculates the quaternion interpolation between two normalized quaternions by an interval fraction.

The two normalized quaternions are the two extremes between which the block calculates the quaternion.

## Parameters

Methods

Specify the quaternion interpolation method to calculate the quaternion interpolation. These methods have different rotational velocities, depending on the interval fraction. For more information on interval fractions, see `http://web.mit.edu/2.998/www/QuaternionReport1.pdf`.

• `SLERP`

Quaternion slerp. Spherical linear quaternion interpolation method.

$Slerp\left(p,q,h\right)=p{\left({p}^{*}q\right)}^{h}$ with $h\in \left[0,1\right].$

• `LERP`

Quaternion lerp. Linear quaternion interpolation method.

$LERP\left(p,q,h\right)=p\left(1-h\right)+qh$ with $h\in \left[0,1\right].$

• `NLERP`

Normalized quaternion linear interpolation method.

With $r=LERP\left(p,q,h\right),$ $NLERP\left(p,q,h\right)=\frac{r}{|r|}.$

Action for out-of-range input

Specifies whether out-of-range input causes a warning, error, or no action.

## Inputs and Outputs

InputDimension TypeDescription

First

4-by-1 or 1-by-4 vector

First normalized quaternion for which to calculate the interpolation. This quaternion must be a normalized quaternion

Second

4-by-1 or 1-by-4 vector

Second normalized quaternion for which to calculate the interpolation. This quaternion must be a normalized quaternion.

Third

Scalar

Interval fraction by which to calculate the quaternion interpolation . This value varies between 0 and 1. It represents the intermediate rotation of the quaternion to be calculated. This fraction affects the interpolation method rotational velocities.

OutputDimension TypeDescription

First

double

Natural logarithm of quaternion.