spiral: use cosine for dyanmic scale
This commit is contained in:
parent
32b55ed344
commit
bb63d86a8c
|
@ -143,9 +143,8 @@ pub fn cassini_astroid(ca: f64, cc: f64, aa: f64) -> impl Fn(f64) -> [f64; 2] {
|
|||
pub fn spiral(k: u32) -> impl Fn(f64) -> [f64; 2] {
|
||||
let x2pi = (k as f64) * core::f64::consts::TAU;
|
||||
move |t: f64| {
|
||||
let tstretch = t - 0.5;
|
||||
let tstretch = tstretch * tstretch;
|
||||
let ttcos = (t * core::f64::consts::TAU).cos();
|
||||
let (ttxsin, ttxcos) = (t * x2pi).sin_cos();
|
||||
[tstretch * ttxcos, tstretch * ttxsin]
|
||||
[ttcos * ttxcos, ttcos * ttxsin]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue