Click or drag to resize
DigitalRuneInterpolationHelperSlerp Method (QuaternionF, QuaternionF, Single)
Performs a spherical linear interpolation of the two QuaternionF.

Namespace: DigitalRune.Mathematics.Interpolation
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public static QuaternionF Slerp(
	QuaternionF source,
	QuaternionF target,
	float parameter
)

Parameters

source
Type: DigitalRune.Mathematics.AlgebraQuaternionF
The start quaternion.
target
Type: DigitalRune.Mathematics.AlgebraQuaternionF
The end quaternion.
parameter
Type: SystemSingle
The interpolation factor that lies in the interval [0,1]; also known as interpolation factor or weight of the target value.

Return Value

Type: QuaternionF
The spherical linear interpolation of the two quaternions.
Remarks

Important: The method assumes the quaternions source and target are unit quaternions (i.e. they are normalized).

Rotations specified by unit quaternions can be interpolated with an operation known as spherical linear interpolation (SLERP). The operation is defined as:

slerp(q0, q1, t) = (q0 sin(θ(1-t)) + q1 sin(θt)) / sinθ where

  • q0, q1 are unit quaternions representing start and destination rotation,
  • t is the interpolation factor which lies in the interval [0, 1], and
  • θ is the angle between q0 and q1, which can be determined by the dot product of q0 and q1.

The interpolation parameter can lie outside of the interval [0, 1]. Outside of this interval the method actually performs an extrapolation instead of an interpolation.

See Also