Class SplineCalculator
java.lang.Object
org.gvsig.vectorediting.lib.prov.editvertex.operation.SplineCalculator
- Author:
- fdiaz
-
Constructor Summary
ConstructorsConstructorDescriptionSplineCalculator(double[] y) The constructor calculates the second derivatives of the interpolating function at the tabulated points xi, with xi = (i, y[i]). -
Method Summary
Modifier and TypeMethodDescriptiondoublefn(int n, double t) Returns a cubic-spline interpolated value y for the point between point (n, y[n]) and (n+1, y[n+1), with t ranging from 0 for (n, y[n]) to 1 for (n+1, y[n+1]).
-
Constructor Details
-
SplineCalculator
public SplineCalculator(double[] y) The constructor calculates the second derivatives of the interpolating function at the tabulated points xi, with xi = (i, y[i]). Based on numerical recipes in C, http://www.library.cornell.edu/nr/bookcpdf/c3-3.pdf .- Parameters:
y- Array of y coordinates for cubic-spline interpolation.
-
-
Method Details
-
fn
public double fn(int n, double t) Returns a cubic-spline interpolated value y for the point between point (n, y[n]) and (n+1, y[n+1), with t ranging from 0 for (n, y[n]) to 1 for (n+1, y[n+1]).- Parameters:
n- The start point.t- The distance to the next point (0..1).- Returns:
- A cubic-spline interpolated value.
-