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

Function test_sine_wave

tests/test.rs:37–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36#[test]
37fn test_sine_wave() {
38 let mut xs = [0.; 1000];
39
40 let mut add = 0f64;
41 for idx in 0..1000 {
42 xs[idx] = add / 1000.;
43 add += 1.;
44 }
45
46 let mut ys = [0.; 1000];
47 for (i, y) in ys.iter_mut().enumerate() {
48 *y = (2. * std::f64::consts::PI * xs[i]).sin();
49 }
50
51 let plot = Plot::new((xs, ys));
52 plot.show();
53}
54
55#[test]
56fn test_x_squared() {

Callers

nothing calls this directly

Calls 1

showMethod · 0.45

Tested by

no test coverage detected