pub mod goodness;
mod align;
mod evaluate;
mod expand;
mod reduce;
mod subdivide;
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Linear<T>([T; 2]);
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Quadratic<T>([T; 3]);
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Cubic<T>([T; 4]);
impl<T> Linear<T> {
#[inline]
pub fn new(a: T, b: T) -> Self {
Self([a, b])
}
}
impl<T> Quadratic<T> {
#[inline]
pub fn new(a: T, b: T, c: T) -> Self {
Self([a, b, c])
}
}
impl<T> Cubic<T> {
#[inline]
pub fn new(a: T, b: T, c: T, d: T) -> Self {
Self([a, b, c, d])
}
}
impl<T> std::ops::Deref for Linear<T> {
type Target = [T; 2];
#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<T> std::ops::DerefMut for Linear<T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<T> std::ops::Deref for Quadratic<T> {
type Target = [T; 3];
#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<T> std::ops::DerefMut for Quadratic<T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<T> std::ops::Deref for Cubic<T> {
type Target = [T; 4];
#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<T> std::ops::DerefMut for Cubic<T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}