Usage

Histogram

rust let mut hist = Histogram::new(0.0, 1.0, 10); // from, to, number of buckets let data = vec![0.0, 0.1, 0.2, 3.0]; hist.add_all(&data); hist.save_img("plot.png", "Plot Name", "X axis", "Y Axis");

MonteCarlo

rust let mc = MonteCarlo::default(); let vec: Vec<f64> = mc.sample_iter(1_000).collect(); // iter of vector of 1_000 f64 let vec: Vec<(f64, f64, f64)> = mc.sample_iter(1_000).collect(); // iter of vector of 1_000 (f64, f64, f64)

Custom Randomizable

```rust fn something() { let mc = MonteCarlo::default(); let vec: Vec = mc.sampleiter(1000).collect(); }

struct PolarCoord { r: f64, theta: f64, }

impl PolarCoord { pub fn new(r: f64, theta: f64) -> Self { let theta = theta % (2.0 * PI); PolarCoord { r, theta } } }

impl Randomizable for PolarCoord { fn sample, R: Rng + ?Sized>(distr: &D, rng: &mut R) -> Self { Self::new(distr.sample(rng), distr.sample(rng) * 2.0 * PI) } } ```