C4 Engine Terathon Software C4 Engine API Documentation

• Math Library

API Links
Developer Links

Math::CalculateEigensystem

Defined in:  C4Computation.h
Calculates eigenvalues and eigenvectors for a 3 × 3 symmetric matrix.
Prototype

void CalculateEigensystem(const Matrix3D& m, Vector3D *eigenvalue, Matrix3D *eigenvector);

Parameters
m The 3 × 3 matrix for which the eigensystem is calculated. This must a symmetric matrix.
eigenvalue A pointer to a Vector3D object in which the three eigenvalues are returned.
eigenvector A pointer to a Matrix3D object whose columns contain the three eigenvectors upon return.
Description
The CalculateEigensystem function calculates eigenvalues and eigenvectors of the 3 × 3 symmetric matrix given by the m parameter. The three eigenvalues are returned in the three components of the Vector3D object pointed to by the eigenvalue parameter, and the three eigenvectors are returned in the columns of the Matrix3D object pointed to by the eigenvector parameter. The first, second, and third columns of the eigenvector matrix correspond to the x, y, and z coordinates of the eigenvalue vector, respectively.