Quaternion

Detailed Description

Functions

Quaternion QSlerp (const Quaternion &q1, const Quaternion &q2, Float64 alfa)
 
Quaternion QSquad (const Quaternion &q0, const Quaternion &q1, const Quaternion &q2, const Quaternion &q3, Float64 alfa)
 
Quaternion QBlend (const Quaternion &q1, const Quaternion &q2, const Float64 r)
 
Quaternion QSpline (const Quaternion &qn_m1, const Quaternion &qn, const Quaternion &qn_p1, const Quaternion &qn_p2, Float64 t)
 
Quaternion QSmoothCubic (const Quaternion &qn_m1, const Quaternion &qn, const Quaternion &qn_p1, Float64 t)
 
Quaternion QNorm (const Quaternion &q)
 
Quaternion QMul (const Quaternion &q1, const Quaternion &q2)
 
Quaternion QMul (const Quaternion &q, Float64 s)
 
Quaternion QAdd (const Quaternion &q1, const Quaternion &q2)
 
Quaternion QSub (const Quaternion &q1, const Quaternion &q2)
 
Quaternion QInvert (const Quaternion &q)
 
Float64 QDot (const Quaternion &q1, const Quaternion &q2)
 
Quaternion QDeriv (const Quaternion &q, const Vector64 &w)
 
Quaternion QLogN (const Quaternion &q)
 
Quaternion QExpQ (const Quaternion &q)
 

Function Documentation

◆ QSlerp()

Quaternion QSlerp ( const Quaternion q1,
const Quaternion q2,
Float64  alfa 
)

Linear interpolates the quaternions q1 and q2 with the parameter alpha.

Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.
[in]alfaThe interpolation parameter. Between 0.0 (q1) and 1.0 (q2).
Returns
The interpolated quaternion.

◆ QSquad()

Quaternion QSquad ( const Quaternion q0,
const Quaternion q1,
const Quaternion q2,
const Quaternion q3,
Float64  alfa 
)

Cubic interpolates the quaternions q1 and q2 with parameter alpha using spherical quadrangle interpolation. q0 and q3 are used to provide C1-continuity at the borders (tangents): q0 = i-1, q1 = i, q2 = i+1, q3 = i+2

Parameters
[in]q0The first quaternion to provide continuity.
[in]q1The first quaternion to interpolate from.
[in]q2The second quaternion to interpolate from.
[in]q3The second quaternion to provide continuity.
[in]alfaThe interpolation parameter. Between 0.0 (q1) and 1.0 (q2).
Returns
The interpolated quaternion.

◆ QBlend()

Quaternion QBlend ( const Quaternion q1,
const Quaternion q2,
const Float64  r 
)

Smooth interpolates the quaternions q1 and q2 with parameter r.

Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.
[in]rThe blending parameter. Between 0.0 (q1) and 1.0 (q2).
Returns
The interpolated quaternion.

◆ QSpline()

Quaternion QSpline ( const Quaternion qn_m1,
const Quaternion qn,
const Quaternion qn_p1,
const Quaternion qn_p2,
Float64  t 
)

Smooth blends the quaternions qn and qn_p1 using spherical spline interpolation with parameter t.
qn_m1 (-1) and qn_p2 (-1+2) are used to provide C1-continuity at the borders (tangents).

Parameters
[in]qn_m1The first quaternion (-1) to provide continuity.
[in]qnThe first quaternion to interpolate from.
[in]qn_p1The second quaternion to interpolate from.
[in]qn_p2The second quaternion (+2) to provide continuity.
[in]tThe blending parameter. Between 0.0 (qn) and 1.0 (qn_p1).
Returns
The interpolated quaternion.

◆ QSmoothCubic()

Quaternion QSmoothCubic ( const Quaternion qn_m1,
const Quaternion qn,
const Quaternion qn_p1,
Float64  t 
)

Smooth blends the quaternions qn and qn_p1 using Cubic interpolation with parameter t.
qn_m1 (-1) and qn_p2 (-1+2) are used to provide C1-continuity at the borders (tangents).

Since
R18
Parameters
[in]qn_m1The first quaternion (-1) to provide continuity.
[in]qnThe first quaternion to interpolate from.
[in]qn_p1The second quaternion to interpolate from.
[in]tThe blending parameter. Between 0.0 (qn) and 1.0 (qn_p1).
Returns
The interpolated quaternion.

◆ QNorm()

Quaternion QNorm ( const Quaternion q)

Gets a normalized copy of quaternion q.

Parameters
[in]qThe quaternion to normalize.
Returns
A normalized copy of q.

◆ QMul() [1/2]

Quaternion QMul ( const Quaternion q1,
const Quaternion q2 
)

Calculates the quaternion product of quaternions q1 and q2.

Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.
Returns
The quaternion product of q1 and q2.

◆ QMul() [2/2]

Quaternion QMul ( const Quaternion q,
Float64  s 
)

Calculates the product of quaternion q with scalar s.

Parameters
[in]qThe quaternion.
[in]sThe scalar.
Returns
The product of q with s.

◆ QAdd()

Quaternion QAdd ( const Quaternion q1,
const Quaternion q2 
)

Calculates the quaternion addition of quaternions q1 and q2.

Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.
Returns
The quaternion addition of q1 and q2.

◆ QSub()

Quaternion QSub ( const Quaternion q1,
const Quaternion q2 
)

Calculates the quaternion subtraction of quaternions q1 and q2.

Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.
Returns
The quaternion subtraction of q1 and q2.

◆ QInvert()

Quaternion QInvert ( const Quaternion q)

Calculates the inverse of quaternion q.

Parameters
[in]qThe quaternion.
Returns
The quaternion inverse of q.

◆ QDot()

Float64 QDot ( const Quaternion q1,
const Quaternion q2 
)

Calculates the Dot Product between q1 and q2.

Since
R18
Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.
Returns
The Dot Product of q1 and q2.

◆ QDeriv()

Quaternion QDeriv ( const Quaternion q,
const Vector64 w 
)

Calculates the derivative of quaternion q by vector w.

Parameters
[in]qThe quaternion.
[in]wThe vector.
Returns
The quaternion derivative of q by w.

◆ QLogN()

Quaternion QLogN ( const Quaternion q)

Calculates the natural logarithm of quaternion q.

Parameters
[in]qThe quaternion.
Returns
The natural logarithm of q.

◆ QExpQ()

Quaternion QExpQ ( const Quaternion q)

Calculates the exponential of quaternion q.

Parameters
[in]qThe quaternion.
Returns
The exponential of q.