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

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

Parameters

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

Return Value

Type: QuaternionD
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