mirror of
https://github.com/drewcassidy/vector-victor.git
synced 2024-09-01 14:58:35 +00:00
23 lines
478 B
Rust
23 lines
478 B
Rust
|
use num_traits::Pow;
|
||
|
|
||
|
pub trait Dot<RHS> {
|
||
|
type Output;
|
||
|
fn dot(&self, other: &RHS) -> <Self as Dot<RHS>>::Output;
|
||
|
}
|
||
|
|
||
|
pub trait Cross<RHS> {
|
||
|
type Output;
|
||
|
fn cross(&self, other: &RHS) -> <Self as Cross<RHS>>::Output;
|
||
|
}
|
||
|
|
||
|
pub trait Mult<RHS> {
|
||
|
type Output;
|
||
|
fn mult(&self, other: &RHS) -> <Self as Mult<RHS>>::Output;
|
||
|
}
|
||
|
|
||
|
pub trait Magnitude<T: Pow<f32>> {
|
||
|
fn sqrmag(&self) -> T;
|
||
|
fn mag(&self) -> <T as Pow<f32>>::Output;
|
||
|
fn norm(&self) -> Self;
|
||
|
}
|