use std::ops;
pub trait Vector:
ops::Add
+ ops::AddAssign
+ ops::Sub
+ ops::SubAssign
+ PartialEq
+ PartialOrd
+ Sized
{
type Scalar;
fn zero() -> Self;
fn magnitude(&self) -> Self::Scalar;
fn normalized(self) -> Self;
fn normalize(&mut self);
fn sqr_magnitude(&self) -> Self::Scalar;
fn angle(&self, other: &Self) -> Self::Scalar;
fn clamp_magnitude(self, max_len: Self::Scalar) -> Self;
fn dot(&self, other: &Self) -> Self::Scalar;
fn scale(self, other: Self) -> Self;
fn lerp(self, other: Self, t: Self::Scalar) -> Self;
fn lerp_unclamped(self, other: Self, t: Self::Scalar) -> Self;
fn max(self, other: Self) -> Self {
if self >= other { self } else { other }
}
fn min(self, other: Self) -> Self {
if self <= other { self } else { other }
}
fn reflect(self, normal: Self) -> Self;
}