sine_wave/sine_wave.rs
1use graplot::Plot;
2
3fn main() {
4 let mut xs = [0.; 1000];
5
6 let mut add = 0f64;
7 for idx in 0..1000 {
8 xs[idx] = add / 1000.;
9 add += 1.;
10 }
11
12 let mut ys = [0.; 1000];
13 for (i, y) in ys.iter_mut().enumerate() {
14 *y = (2. * std::f64::consts::PI * xs[i]).sin();
15 }
16
17 let plot = Plot::new((xs, ys));
18 let _thread = std::thread::Builder::new().name("test".to_string());
19
20 //thread.spawn(|| {
21 plot.show();
22 //}).unwrap().join().unwrap()
23}