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