MCPcopy Create free account
hub / github.com/elftausend/graplot / main

Function main

examples/sine.rs:3–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 2

xFunction · 0.85
showMethod · 0.45

Tested by

no test coverage detected