PAL Geometry: Quaternion Algebra

Hamilton products, normalization, and inversion for quaternions and quaternion sequences.

PAL Geometry: Quaternion Algebra — 14 functions

KiratPalGeom3DInv1DQuat

Signature
void KiratPalGeom3DInv1DQuat(T_FLOAT** ppfQuat, T_INT iSize);
Description
Inverts quaternion values; for unit quaternions this is equivalent to conjugation.
Mathematical operation
\(q^-1=q^*/(\|q\|_2^2+\varepsilon_{\mathrm{SYS}})\) (sequence variants element-wise).

KiratPalGeom3DInvQuat

Signature
void KiratPalGeom3DInvQuat(T_FLOAT* pfQuat);
Description
Inverts quaternion values; for unit quaternions this is equivalent to conjugation.
Mathematical operation
\(q^-1=q^*/(\|q\|_2^2+\varepsilon_{\mathrm{SYS}})\) (sequence variants element-wise).

KiratPalGeom3DMult1DQuatWith1DQuatToA

Signature
void KiratPalGeom3DMult1DQuatWith1DQuatToA(T_FLOAT** ppfQuatA, T_FLOAT** ppfQuatB, T_INT iSize);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMult1DQuatWith1DQuatToB

Signature
void KiratPalGeom3DMult1DQuatWith1DQuatToB(T_FLOAT** ppfQuatA, T_FLOAT** ppfQuatB, T_INT iSize);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMult1DQuatWith1DQuatToC

Signature
void KiratPalGeom3DMult1DQuatWith1DQuatToC( T_FLOAT** ppfQuatA, T_FLOAT** ppfQuatB, T_FLOAT** ppfQuatC, T_INT iSize);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMult1DQuatWithQuatToA

Signature
void KiratPalGeom3DMult1DQuatWithQuatToA(T_FLOAT** ppfQuatA, T_FLOAT* pfQuatB, T_INT iSize);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMult1DQuatWithQuatToC

Signature
void KiratPalGeom3DMult1DQuatWithQuatToC( T_FLOAT** ppfQuatA, T_FLOAT* pfQuatB, T_FLOAT** ppfQuatC, T_INT iSize);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMultQuatWith1DQuatToB

Signature
void KiratPalGeom3DMultQuatWith1DQuatToB(T_FLOAT* pfQuatA, T_FLOAT** ppfQuatB, T_INT iSize);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMultQuatWith1DQuatToC

Signature
void KiratPalGeom3DMultQuatWith1DQuatToC( T_FLOAT* pfQuatA, T_FLOAT** ppfQuatB, T_FLOAT** ppfQuatC, T_INT iSize);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMultQuatWithQuatToA

Signature
void KiratPalGeom3DMultQuatWithQuatToA(T_FLOAT* pfQuatA, T_FLOAT* pfQuatB);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMultQuatWithQuatToB

Signature
void KiratPalGeom3DMultQuatWithQuatToB(T_FLOAT* pfQuatA, T_FLOAT* pfQuatB);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DMultQuatWithQuatToC

Signature
void KiratPalGeom3DMultQuatWithQuatToC(T_FLOAT* pfQuatA, T_FLOAT* pfQuatB, T_FLOAT* pfQuatC);
Description
Calculates the Hamilton product of two quaternions; 1D variants process sequences of quaternions.
Mathematical operation
For \(q_a=(w_a,\mathbf v_a)\) and \(q_b=(w_b,\mathbf v_b)\): \(q_a\otimes q_b=(w_aw_b-\mathbf v_a\cdot\mathbf v_b,\;w_a\mathbf v_b+w_b\mathbf v_a+\mathbf v_a\times\mathbf v_b)\).

KiratPalGeom3DNorm1DQuat

Signature
void KiratPalGeom3DNorm1DQuat(T_FLOAT** ppfQuat, T_INT iSize);
Description
Normalizes quaternion values to unit norm.
Mathematical operation
\(q\leftarrow q/(\sqrt{w^2+x^2+y^2+z^2}+\varepsilon_{\mathrm{SYS}})\) (sequence variants element-wise).

KiratPalGeom3DNormQuat

Signature
void KiratPalGeom3DNormQuat(T_FLOAT* pfQuat);
Description
Normalizes quaternion values to unit norm.
Mathematical operation
\(q\leftarrow q/(\sqrt{w^2+x^2+y^2+z^2}+\varepsilon_{\mathrm{SYS}})\) (sequence variants element-wise).