QSpline is a simple implementation of cubic spline interpolation in C.
git clone https://github.com/gmguarino/QSpline.git
sudo apt update
sudo apt install gnuplot
brew install gnuplot --with-x11
Download from their repo
https://sourceforge.net/projects/gnuplot/files/gnuplot/
To run the demo simply execute the shell script execute.sh
(Linux).
The results are plotted and saved to out.jpeg
:
Compile the example program interp.c
:
gcc -o interp interp.c QSpline.c -lm
Run the executable:
./interp
Plot the results using the .plot
script in gnuplot:
gnuplot plotter.plot > out.jpeg
The results will be still stored in out.jpeg
.
Always clean up after yourself:
rm interp undersampled.dat interpolated.dat