Package de.gsi.math
Class Spline
- java.lang.Object
-
- de.gsi.math.Spline
-
public class Spline extends java.lang.Objectclass implementing natural cubic splines according to: http://en.wikipedia.org/wiki/Spline_(mathematics)- Author:
- rstein
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetValue(double x)returns the cubic-spline interpolated value at xvoidprintCoefficients()Debug out-put of the spline fix-points and coefficientsjava.lang.StringtoString()
-
-
-
Constructor Detail
-
Spline
public Spline(double[] x, double[] y)default constructor- Parameters:
x- array of horizontal coordinatesy- array of vertical coordinates Both arrays are expected to be sorted. The horizontal array should not contain entries with the same value. The default dimension is derived from the- See Also:
Spline(double[] x, double[] y, int length, int scrPos)
-
Spline
public Spline(double[] x, double[] y, int length, int scrPos)- Parameters:
x- array of horizontal coordinatesy- array of vertical coordinateslength- length of the datascrPos- first index of the data Both arrays are expected to be sorted. The horizontal array should not contain entries with the same value. It is implicitly required that: 0 <= srcPos <= srcPos+length < x.length and length > 3
-
-
Method Detail
-
getValue
public double getValue(double x)
returns the cubic-spline interpolated value at x- Parameters:
x- input parameter- Returns:
- cubic-spline interpolated value at x
-
printCoefficients
public void printCoefficients()
Debug out-put of the spline fix-points and coefficients
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-