TVector

qm::v

Trait TVector 

Source
pub trait TVector<F: Float + Debug> {
    // Required methods
    fn new(v: &Vec<F>) -> Self;
    fn prec_eq(&self, e: F, v: &impl TVector<F>) -> bool;
    fn to_vec(&self) -> Vec<F>;
    fn me(&self) -> &[F];
    fn dot(&self, a: &impl TVector<F>) -> F;
    fn dot_mv(&self, m: &impl TMatrix<F>) -> Self;
    fn cross(&self, b: &impl TVector<F>) -> Self;
}
Expand description

TVector

Required Methods§

Source

fn new(v: &Vec<F>) -> Self

constructor

Source

fn prec_eq(&self, e: F, v: &impl TVector<F>) -> bool

check equal with precision

Source

fn to_vec(&self) -> Vec<F>

to_vec

Source

fn me(&self) -> &[F]

like as slice

Source

fn dot(&self, a: &impl TVector<F>) -> F

a dot self

Source

fn dot_mv(&self, m: &impl TMatrix<F>) -> Self

m dot self

Source

fn cross(&self, b: &impl TVector<F>) -> Self

self cross b

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F: Float + Debug + Sum> TVector<F> for Vector3<F>

TVector for Vector3

Source§

impl<F: Float + Debug + Sum> TVector<F> for Vector4<F>

TVector for Vector4