Class FastQuaternionSVD
Fast Approximate SVD of 3x3 matrix that returns quaternions. Implemented based on https://github.com/benjones/quatSVD/blob/master/quatSVD.hpp which was re-implemented from http://pages.cs.wisc.edu/~sifakis/project_pages/svd.html
By default, only does a small number of diagonalization iterations (4), which limits the accuracy of the solution. Results are still orthonormal but error when reconstructing matrix will be larger. This is fine for many applications. Can increase accuracy by increasing NumJacobiIterations parameter
Note: does not produce same quaternions as running SingularValueDecomposition on matrix and converting resulting U/V to quaternions. The numbers will be similar but the signs will be different
Useful properties:
- quaternions are rotations, there are no mirrors like in normal SVD
TODO:
- SymmetricMatrix3d currently a class, could make a struct (see comments)
Inherited Members
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class FastQuaternionSVD
Constructors
FastQuaternionSVD()
Declaration
public FastQuaternionSVD()
FastQuaternionSVD(Matrix3d, Double, Int32)
Declaration
public FastQuaternionSVD(Matrix3d matrix, double epsilon = 2.2204460492503131E-16, int jacobiIters = 4)
Parameters
Type | Name | Description |
---|---|---|
Matrix3d | matrix | |
Double | epsilon | |
Int32 | jacobiIters |
Fields
S
Declaration
public Vector3d S
Field Value
Type | Description |
---|---|
Vector3d |
U
Declaration
public Quaterniond U
Field Value
Type | Description |
---|---|
Quaterniond |
V
Declaration
public Quaterniond V
Field Value
Type | Description |
---|---|
Quaterniond |
Methods
ReconstructMatrix()
Compute U * S * V^T, useful for error-checking
Declaration
public Matrix3d ReconstructMatrix()
Returns
Type | Description |
---|---|
Matrix3d |
Solve(Matrix3d, Double, Int32)
Declaration
public void Solve(Matrix3d matrix, double epsilon = 2.2204460492503131E-16, int jacobiIters = -1)
Parameters
Type | Name | Description |
---|---|---|
Matrix3d | matrix | |
Double | epsilon | |
Int32 | jacobiIters |