goog.math.interpolator.Pchip1
Provided By | |
---|---|
Extends | |
All Implemented Interfaces |
A one dimensional monotone cubic spline interpolator.
new Pchip1()
Parameters | None. |
---|
Instance Methods
Computes the derivative at each point of the spline such that the curve is C2. It uses not-a-knot boundary conditions.
Overrides | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.getInverse() → goog.math.interpolator.Interpolator1
goog.math.interpolator.Interpolator1
Computes the inverse interpolator. That is, it returns invInterp s.t. this.interpolate(invInterp.interpolate(t))) = t. Note that the inverse interpolator is only well defined if the data being interpolated is 'invertible', i.e. it represents a bijective function. In addition, the returned interpolator is only guaranteed to give the exact inverse at the input data passed in getData. If 'this' has no data, the returned Interpolator will be empty as well.
Overrides | |||
---|---|---|---|
Specified by | |||
Parameters | None. | ||
Returns |
|
this.interpolate( x ) → number
number
this.setData( x, y ) → void
void
Sets the data to be interpolated. Note that the data points are expected to be sorted according to their abscissa values and not have duplicate values. E.g. calling setData([0, 0, 1], [1, 1, 3]) may give undefined results, the correct call should be setData([0, 1], [1, 3]). Calling setData multiple times does not merge the data samples. The last call to setData is the one used when computing the interpolation.
Overrides | |||||||||
---|---|---|---|---|---|---|---|---|---|
Specified by | |||||||||
Parameters |
|