mod eisenstein;
mod penrose;
mod style;
mod multiscale;
pub use eisenstein::EisensteinLattice;
pub use penrose::PenroseEncoder;
pub use style::StyleVector;
pub use multiscale::ScaleLevel;
use std::f64::consts::PI;
pub const PHI: f64 = 1.6180339887498948482045868343656381177;
pub const FIFTH_ROOTS: [(f64, f64); 5] = [
(1.0, 0.0),
(0.30901699437494745, 0.9510565162951535), (-0.8090169943749473, 0.5877852522924732), (-0.8090169943749475, -0.5877852522924730), (0.30901699437494723, -0.9510565162951536), ];
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_phi_precision() {
assert!((PHI - 1.618033988749895).abs() < 1e-14);
}
#[test]
fn test_fifth_roots_length() {
assert_eq!(FIFTH_ROOTS.len(), 5);
for (re, im) in &FIFTH_ROOTS {
let mag = (re * re + im * im).sqrt();
assert!((mag - 1.0).abs() < 1e-14, "Root magnitude should be 1, got {}", mag);
}
}
}