pub struct SymmetricEigen3A {
pub eigenvalues: Vec3A,
pub eigenvectors: Mat3A,
}Expand description
The eigen decomposition of a symmetric 3x3 matrix (f32 precision).
Fields§
§eigenvalues: Vec3AThe eigenvalues of the symmetric 3x3 matrix.
eigenvectors: Mat3AThe three eigenvectors of the symmetric 3x3 matrix (as columns).
Implementations§
Source§impl SymmetricEigen3A
impl SymmetricEigen3A
Sourcepub fn new(mat: Mat3A) -> Self
pub fn new(mat: Mat3A) -> Self
Computes the eigen decomposition of the given symmetric 3x3 matrix.
The eigenvalues are returned in ascending order eigen1 < eigen2 < eigen3.
This can be reversed with the reverse method.
Sourcepub fn reverse(&self) -> Self
pub fn reverse(&self) -> Self
Reverses the order of the eigenvalues and their corresponding eigenvectors.
Sourcepub fn eigenvalues(mat: Mat3A) -> Vec3A
pub fn eigenvalues(mat: Mat3A) -> Vec3A
Computes the eigenvalues of a symmetric 3x3 matrix.
Reference: https://en.wikipedia.org/wiki/Eigenvalue_algorithm#3%C3%973_matrices
Sourcepub fn eigenvector1(mat: Mat3A, eigenvalue1: f32) -> Vec3A
pub fn eigenvector1(mat: Mat3A, eigenvalue1: f32) -> Vec3A
Computes the unit-length eigenvector corresponding to the eigenvalue1 of mat that was
computed from the root of a cubic polynomial with a multiplicity of 1.
If the other two eigenvalues are well separated, this method can be used for computing
all three eigenvectors. However, to avoid numerical issues when eigenvalues are close to
each other, it’s recommended to use the eigenvector2 method for the second eigenvector.
The third eigenvector can be computed as the cross product of the first two.
Sourcepub fn eigenvector2(mat: Mat3A, eigenvector1: Vec3A, eigenvalue2: f32) -> Vec3A
pub fn eigenvector2(mat: Mat3A, eigenvector1: Vec3A, eigenvalue2: f32) -> Vec3A
Computes the unit-length eigenvector corresponding to the eigenvalue2 of mat that was
computed from the root of a cubic polynomial with a potential multiplicity of 2.
The third eigenvector can be computed as the cross product of the first two.
Sourcepub fn eigenvector3(eigenvector1: Vec3A, eigenvector2: Vec3A) -> Vec3A
pub fn eigenvector3(eigenvector1: Vec3A, eigenvector2: Vec3A) -> Vec3A
Computes the third eigenvector as the cross product of the first two. If the given eigenvectors are valid, the returned vector should be unit length.
Trait Implementations§
Source§impl Clone for SymmetricEigen3A
impl Clone for SymmetricEigen3A
Source§fn clone(&self) -> SymmetricEigen3A
fn clone(&self) -> SymmetricEigen3A
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SymmetricEigen3A
impl Debug for SymmetricEigen3A
Source§impl From<DSymmetricEigen3> for SymmetricEigen3A
impl From<DSymmetricEigen3> for SymmetricEigen3A
Source§fn from(e: DSymmetricEigen3) -> Self
fn from(e: DSymmetricEigen3) -> Self
Source§impl From<SymmetricEigen3> for SymmetricEigen3A
impl From<SymmetricEigen3> for SymmetricEigen3A
Source§fn from(e: SymmetricEigen3) -> Self
fn from(e: SymmetricEigen3) -> Self
Source§impl From<SymmetricEigen3A> for DSymmetricEigen3
impl From<SymmetricEigen3A> for DSymmetricEigen3
Source§fn from(e: SymmetricEigen3A) -> Self
fn from(e: SymmetricEigen3A) -> Self
Source§impl From<SymmetricEigen3A> for SymmetricEigen3
impl From<SymmetricEigen3A> for SymmetricEigen3
Source§fn from(e: SymmetricEigen3A) -> Self
fn from(e: SymmetricEigen3A) -> Self
Source§impl PartialEq for SymmetricEigen3A
impl PartialEq for SymmetricEigen3A
impl Copy for SymmetricEigen3A
impl StructuralPartialEq for SymmetricEigen3A
Auto Trait Implementations§
impl Freeze for SymmetricEigen3A
impl RefUnwindSafe for SymmetricEigen3A
impl Send for SymmetricEigen3A
impl Sync for SymmetricEigen3A
impl Unpin for SymmetricEigen3A
impl UnwindSafe for SymmetricEigen3A
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.