use nalgebra::Complex;
use num_traits::Float;
use std::marker::PhantomData;
use crate::Attractor;
#[derive(Debug, Clone, Copy)]
pub struct Gingerbreadman<T> {
_phantom: PhantomData<T>,
}
impl<T> Gingerbreadman<T> {
#[must_use]
#[inline]
pub const fn new() -> Self {
Self { _phantom: PhantomData }
}
}
impl<T: Float + Copy> Attractor<T> for Gingerbreadman<T> {
#[inline]
fn iterate(&self, p: Complex<T>) -> Complex<T> {
let x = p.re;
let y = p.im;
Complex::new(T::one() - y + x.abs(), x)
}
}