eigensystem_3_classical

Function eigensystem_3_classical 

Source
pub fn eigensystem_3_classical<S>(
    matrix: Matrix3<S>,
) -> [Option<(S, Vector3<S>)>; 3]
where S: Real + Cbrt + NumCast + RelativeEq<Epsilon = S> + Debug,
Expand description

Return the (real-valued) eigenvalues and eigenvectors (eigenpairs) of a diagonalizable 3x3 matrix as computed by the classical method of computing the roots of the characteristic polynomial. Note that the root-finding problem is ill-conditioned so this may not return accurate results.

Returns [Some, None, None] if matrix is orthogonal, e.g. a rotation):

let mat = Matrix3::<f32>::from_row_arrays ([
  [0.0, -1.0, 0.0],
  [0.0,  0.0, 1.0],
  [1.0,  0.0, 0.0]
]);
assert!(matches!(eigensystem_3_classical (mat), [Some (_), None, None]));

Returns [Some, None, None] or [Some, Some, None] if the matrix has only one or two eigenvector directions:

let mat = Matrix3::<f32>::from_row_arrays ([
  [0.0, 1.0, 0.0],
  [0.0, 0.0, 1.0],
  [0.0, 0.0, 0.0]
]);
assert!(matches!(eigensystem_3_classical (mat), [Some (_), None, None]));
let mat = Matrix3::<f32>::from_row_arrays ([
  [2.0, 1.0, 0.0],
  [0.0, 2.0, 0.0],
  [0.0, 0.0, 2.0]
]);
assert!(matches!(eigensystem_3_classical (mat), [Some (_), Some (_), None]));