diff --git a/src/ex.rs b/src/ex.rs index ebfd1e0..601198c 100644 --- a/src/ex.rs +++ b/src/ex.rs @@ -149,9 +149,10 @@ pub fn spiral(k: u32) -> impl Fn(f64) -> [f64; 2] { } pub fn spiral_1d(k: u32) -> impl Fn(f64) -> [f64; 2] { - let x2pi = (k as f64) * core::f64::consts::TAU; + let k = k as f64; + let x2pi = k * core::f64::consts::TAU; move |t: f64| { - let ttcos = (t * core::f64::consts::TAU).cos(); + let ttcos = k * (t * core::f64::consts::TAU).cos(); let ttxsin = (t * x2pi).sin(); [ttcos, ttxsin] }