Documentation of 'jhpro.interpolator.ConstrainedSplineInterpolator' Java class
ConstrainedSplineInterpolator
jhpro.interpolator

Class ConstrainedSplineInterpolator

  • All Implemented Interfaces:
    UnivariateInterpolator


    public class ConstrainedSplineInterpolator
    extends java.lang.Object
    implements UnivariateInterpolator
    Constrained Spline Interpolation algorithm (CJC Kruger). If we want to avoid overshoot for an arbitrary function, we should find some other interpolation algorithm. One of the methods is called Constrained Cubic Spline Interpolation. It was proposed by CJC Kruger in his article: http://www.korf.co.uk/spline.pdf The algorithms is based on a classic cubic spline algorithm. The key step in it is the calculation of the slope (first derivative) at each point. Intuitively, the slope will be between the slopes of the adjacent straight lines (can be a mean value of the two slopes), but it also should approach zero if the slope of either line approaches zero.
     import android.util.Spline;
     float x[] = ...
     float y[[] = ...
     Spline f = Spline.createMonotoneCubicSpline(x, y);
     
    // this will evaluate y0 = f(x0)
     float y0 = f.interpolate(x0);
     
    Created by Anton Danshin on 24/12/14.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.