diff options
Diffstat (limited to 'src/lerp.rs')
-rw-r--r-- | src/lerp.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lerp.rs b/src/lerp.rs index 1501d0f..b098f23 100644 --- a/src/lerp.rs +++ b/src/lerp.rs @@ -1,18 +1,17 @@ -use crate::number::Number; use crate::poly::Poly; pub enum Lerp { Node(Box<Lerp>, Box<Lerp>), - Leaf(Number, Number), - Just(Number) + Leaf(f32, f32), + Just(f32), } impl Lerp { - pub fn new(v: Vec<Number>) -> Box<Lerp> { + pub fn new(v: Vec<f32>) -> Box<Lerp> { Lerp::new_s(&v[..]) } - fn new_s(v: &[Number]) -> Box<Lerp> { + fn new_s(v: &[f32]) -> Box<Lerp> { match v.len() { 0 => Box::new(Lerp::Just(0.0)), 1 => Box::new(Lerp::Just(v[0])), |