|
Gin
|
Cubic spline interpolation for smooth curves through discrete data points. More...
#include <gin_spline.h>
Classes | |
| class | Element |
Public Member Functions | |
| Spline (const juce::Array< Point< double > > &points) | |
| double | operator[] (double x) const |
| double | interpolate (double x) const |
Cubic spline interpolation for smooth curves through discrete data points.
Spline provides cubic spline interpolation, creating a smooth curve that passes through all given data points. Unlike linear interpolation, cubic splines have continuous first and second derivatives (C1 and C2 continuity), resulting in very smooth, natural-looking curves.
Cubic spline interpolation is ideal for:
Key Features:
Important: Points must be added in increasing x order.
Usage:
Based on implementation by Devin Lane: https://shiftedbits.org/2011/01/30/cubic-spline-interpolation/