Class InterpolantAbstract

Abstract base class of interpolants over parametric samples.

The parameter domain is one dimensional, typically the time or a path along a curve defined by the data.

The sample values can have any dimensionality and derived classes may apply special interpretations to the data.

This class provides the interval seek in a Template Method, deferring the actual interpolation to derived classes.

Time complexity is O(1) for linear access crossing at most two points and O(log N) for random access, where N is the number of positions.

References:

    http://www.oodesign.com/template-method-pattern.html

Hierarchy

Constructors

  • new Interpolant(parameterPositions: any[], sampleValues: any[], sampleSize: number, resultBuffer?: any[]): Interpolant
  • Create a new instance.

    Note: This is not designed to be called directly.

    Parameters

    • parameterPositions: any[]

      array of positions

    • sampleValues: any[]

      array of samples

    • sampleSize: number

      number of samples

    • Optional resultBuffer: any[]

      buffer to store the interpolation results.

    Returns Interpolant

Properties

DefaultSettings_: unknown
_cachedIndex: number
parameterPositions: any[]
resultBuffer?: any[]
sampleValues: any[]
settings: unknown
valueSize: number

Methods

  • copySampleValue_(index: number): any[]
  • Parameters

    • index: number

    Returns any[]

  • evaluate(t: number): any[]
  • Evaluate the interpolant at position t.

    Returns

    An array

    Parameters

    • t: number

      time

    Returns any[]

  • getSettings_(): unknown
  • Returns unknown

  • interpolate_(i1: number, t0?: number, t?: number, t1?: number): unknown
  • Parameters

    • i1: number
    • Optional t0: number
    • Optional t: number
    • Optional t1: number

    Returns unknown

  • intervalChanged_(i1: number, t0?: number, t1?: number): void
  • Parameters

    • i1: number
    • Optional t0: number
    • Optional t1: number

    Returns void