stretch spiral1-d properly

This commit is contained in:
Alain Zscheile 2023-12-11 11:39:23 +01:00
parent 0a720971ba
commit d87ab053cb

View file

@ -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]
}