From 26585e5458cc50964d968eefdabdbca702919fcf Mon Sep 17 00:00:00 2001 From: Juergen Stuber Date: Sat, 21 Oct 2023 21:44:19 +0200 Subject: [PATCH] Adapt scaling for arbitrary sizes --- src/bin/lorenz/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bin/lorenz/main.rs b/src/bin/lorenz/main.rs index d466cba..68e0743 100644 --- a/src/bin/lorenz/main.rs +++ b/src/bin/lorenz/main.rs @@ -44,10 +44,12 @@ fn main() -> std::io::Result<()> { let x0 = (x_size as f64) / 2.0; let y0 = (y_size as f64) / 2.0; + // x = [-20.0,20.0], z = [0.0,50.0] + let xc = 0.0; - let zc = 26.0; - let x_scale = 2.0; - let z_scale = 1.0; + let zc = 25.0; + let x_scale = x0 / 20.0; + let z_scale = y0 / 25.0; let dt = 0.005; let a = 10.0; @@ -59,8 +61,6 @@ fn main() -> std::io::Result<()> { let mut z = zc; loop { - //eprintln!("{:10.3} {:10.3} {:10.3}", x, y, z); - // Decay towards the background color. for row in &mut frame { for pixel in row {