Class MathFunctions

Class Documentation

class MathFunctions

Public Static Functions

static Real infNorm(const Matrix3r &A)

Return the inf norm of the matrix.

static Real oneNorm(const Matrix3r &A)

Return the one norm of the matrix.

static void eigenDecomposition(const Matrix3r &A, Matrix3r &eigenVecs, Vector3r &eigenVals)
static void polarDecomposition(const Matrix3r &A, Matrix3r &R, Matrix3r &U, Matrix3r &D)

Perform polar decomposition A = (U D U^T) R

static void polarDecompositionStable(const Matrix3r &M, const Real tolerance, Matrix3r &R)

Perform a polar decomposition of matrix M and return the rotation matrix R. This method handles the degenerated cases.

static void svdWithInversionHandling(const Matrix3r &A, Vector3r &sigma, Matrix3r &U, Matrix3r &VT)

Perform a singular value decomposition of matrix A: A = U * sigma * V^T. This function returns two proper rotation matrices U and V^T which do not contain a reflection. Reflections are corrected by the inversion handling proposed by Irving et al. 2004.

static Real cotTheta(const Vector3r &v, const Vector3r &w)
static void crossProductMatrix(const Vector3r &v, Matrix3r &v_hat)

Computes the cross product matrix of a vector.

Parameters
  • v – input vector

  • v_hat – resulting cross product matrix

static void extractRotation(const Matrix3r &A, Quaternionr &q, const unsigned int maxIter)

Implementation of the paper:

Matthias Müller, Jan Bender, Nuttapong Chentanez and Miles Macklin, “A Robust Method to Extract the Rotational Part of Deformations”, ACM SIGGRAPH Motion in Games, 2016