pub fn eigensystem_2<S>(matrix: Matrix2<S>) -> [Option<(S, Vector2<S>)>; 2]Expand description
Return the (real-valued) eigenvalues and eigenvectors (eigenpairs) of a diagonalizable 2x2 matrix.
Will be ordered by descending eigenvalues.
Returns [Some((0, Vector2::zero())), None] if the matrix is the zero matrix:
let mat = Matrix2::<f32>::zero();
assert_eq!(eigensystem_2 (mat), [Some ((0.0, Vector2::zero())), None]);Returns [None, None] if eigenvalues are not real values (matrix is orthogonal,
e.g. a rotation):
let mat = Matrix2::<f32>::from_row_arrays ([
[0.0, -1.0],
[1.0, 0.0]
]);
assert_eq!(eigensystem_2 (mat), [None, None]);Returns [Some, None] if the matrix has only one eigenvector direction (matrix is
not diagonalizable):
let mat = Matrix2::<f32>::from_row_arrays ([
[ 3.0, 1.0],
[-1.0, 1.0]
]);
assert!(matches!(eigensystem_2 (mat), [Some(_), None]));