mod array;
mod fixed;
mod general;
mod ops;
use std::fmt::Debug;
use std::iter::Sum;
use num_traits::Float;
use num_traits::Zero;
pub use crate::fixed::*;
pub use crate::general::*;
pub use crate::ops::*;
pub type V1D64 = Vec1D<f64>;
pub type V1D32 = Vec1D<f32>;
pub type V2D64 = Vec2D<f64>;
pub type V2D32 = Vec2D<f32>;
pub type V3D64 = Vec3D<f64>;
pub type V3D32 = Vec3D<f32>;
pub trait Vector:
Clone
+ Copy
+ Debug
+ PartialEq
+ Zero
+ Sum
+ VectorRefOps<Self::Cmp, Self>
+ VectorRefAssignOps<Self::Cmp, Self>
where
for<'l> &'l Self: VectorRefOps<Self::Cmp, Self>,
{
type Cmp: Component;
const DIM: usize;
fn norm_sqr(self) -> Self::Cmp;
fn dot(self, rhs: Self) -> Self::Cmp;
fn is_finite(self) -> bool;
fn has_nan(self) -> bool;
#[inline]
fn norm(self) -> Self::Cmp {
self.norm_sqr().sqrt()
}
#[inline]
fn distance(self, rhs: Self) -> Self::Cmp {
(self - rhs).norm()
}
#[inline]
fn distance_sqr(self, rhs: Self) -> Self::Cmp {
(self - rhs).norm_sqr()
}
}