pub struct DSymmetricEigen3 {
pub eigenvalues: DVec3,
pub eigenvectors: DMat3,
}Expand description
The eigen decomposition of a symmetric 3x3 matrix (f64 precision).
Fields§
§eigenvalues: DVec3The eigenvalues of the symmetric 3x3 matrix.
eigenvectors: DMat3The three eigenvectors of the symmetric 3x3 matrix (as columns).
Implementations§
Source§impl DSymmetricEigen3
impl DSymmetricEigen3
Sourcepub fn new(mat: DMat3) -> Self
pub fn new(mat: DMat3) -> 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: DMat3) -> DVec3
pub fn eigenvalues(mat: DMat3) -> DVec3
Computes the eigenvalues of a symmetric 3x3 matrix.
Reference: https://en.wikipedia.org/wiki/Eigenvalue_algorithm#3%C3%973_matrices
Sourcepub fn eigenvector1(mat: DMat3, eigenvalue1: f64) -> DVec3
pub fn eigenvector1(mat: DMat3, eigenvalue1: f64) -> DVec3
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: DMat3, eigenvector1: DVec3, eigenvalue2: f64) -> DVec3
pub fn eigenvector2(mat: DMat3, eigenvector1: DVec3, eigenvalue2: f64) -> DVec3
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: DVec3, eigenvector2: DVec3) -> DVec3
pub fn eigenvector3(eigenvector1: DVec3, eigenvector2: DVec3) -> DVec3
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 DSymmetricEigen3
impl Clone for DSymmetricEigen3
Source§fn clone(&self) -> DSymmetricEigen3
fn clone(&self) -> DSymmetricEigen3
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DSymmetricEigen3
impl Debug for DSymmetricEigen3
Source§impl From<DSymmetricEigen3> for SymmetricEigen3
impl From<DSymmetricEigen3> for SymmetricEigen3
Source§fn from(e: DSymmetricEigen3) -> Self
fn from(e: DSymmetricEigen3) -> Self
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 DSymmetricEigen3
impl From<SymmetricEigen3> for DSymmetricEigen3
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 PartialEq for DSymmetricEigen3
impl PartialEq for DSymmetricEigen3
impl Copy for DSymmetricEigen3
impl StructuralPartialEq for DSymmetricEigen3
Auto Trait Implementations§
impl Freeze for DSymmetricEigen3
impl RefUnwindSafe for DSymmetricEigen3
impl Send for DSymmetricEigen3
impl Sync for DSymmetricEigen3
impl Unpin for DSymmetricEigen3
impl UnwindSafe for DSymmetricEigen3
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.