From bc93c35999bbfd78e10e0fd03e6e03aaa1745ab8 Mon Sep 17 00:00:00 2001 From: Marc Planard Date: Mon, 19 Aug 2024 10:56:33 +0200 Subject: [PATCH] add SCALE const in simple_client --- examples/simple_client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/simple_client.rs b/examples/simple_client.rs index 9cb8eff..fab3c6b 100644 --- a/examples/simple_client.rs +++ b/examples/simple_client.rs @@ -10,6 +10,8 @@ use redis::{ use std::thread::sleep; use std::time::{Duration, Instant}; +const SCALE: f32 = 500.0; + fn do_something() -> redis::RedisResult<()> { let client = Client::open("redis://127.0.0.1/")?; let mut con: Connection = client.get_connection()?; @@ -23,7 +25,7 @@ fn do_something() -> redis::RedisResult<()> { for i in 0..128 { let a = (time + i as f32) / 128.0 * std::f32::consts::PI * 2.0; - let r = 4800.0 + (a * 5.0).cos() * (2000.0 * (time / 5.0).cos()); + let r = 24.0 * SCALE + (a * 5.0).cos() * (10.0 * SCALE * (time / 5.0).cos()); let x = a.cos() * r; let y = a.sin() * r;