Curve Sampling
This module provide a collection of routines to perform adaptive sampling of curves as well as manipulating those samplings.
Usage
Add this to your Cargo.toml
:
[dependencies]
curve-sampling = "0.1.0"
See the documentation.
Example
To sample the function x ↦ x sin(1/x) on the interval [-0.4, 0.4] with 227 function evaluations, simply do
use Sampling;
let s = fun.n.build;
You can save the resulting sampling to TikZ with
s.latex.write?;
or to a data file (whose format is compatible with Gnuplot) with
s.write?;
Asking Gnuplot to draw the resulting curve (with plot 'graph.dat'
)
yields:
P.S. The number of evaluations (227) was chosen to match a depth 5 recursion for Mathematica.