public class CubicSplineInterpolator extends Plottable
WARNING: So far, this class cannot handle NaN datasource values (an exception will be thrown by the constructor). Future releases might change this.
Constructor and Description |
---|
CubicSplineInterpolator(Calendar[] dates,
double[] values)
Creates cubic spline interpolator from arrays of GregorianCalendar objects and corresponding
datasource values.
|
CubicSplineInterpolator(Date[] dates,
double[] values)
Creates cubic spline interpolator from arrays of Date objects and corresponding
datasource values.
|
CubicSplineInterpolator(double[] x,
double[] y)
Creates cubic spline interpolator for an array of 2D-points.
|
CubicSplineInterpolator(long[] timestamps,
double[] values)
Creates cubic spline interpolator from arrays of timestamps and corresponding
datasource values.
|
public CubicSplineInterpolator(long[] timestamps, double[] values)
timestamps
- timestamps in secondsvalues
- corresponding datasource valuesIllegalArgumentException
- Thrown if supplied arrays do not contain at least 3 values, or if
timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.public CubicSplineInterpolator(Date[] dates, double[] values)
dates
- Array of Date objectsvalues
- corresponding datasource valuesIllegalArgumentException
- Thrown if supplied arrays do not contain at least 3 values, or if
timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.public CubicSplineInterpolator(Calendar[] dates, double[] values)
dates
- Array of GregorianCalendar objectsvalues
- corresponding datasource valuesIllegalArgumentException
- Thrown if supplied arrays do not contain at least 3 values, or if
timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.public CubicSplineInterpolator(double[] x, double[] y)
x
- x-axis point coordinatesy
- y-axis point coordinatesIllegalArgumentException
- Thrown if supplied arrays do not contain at least 3 values, or if
timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN.public double getValue(double xval)
xval
- x-valuepublic double getValue(long timestamp)
Copyright © 2015. All rights reserved.