Interpolant - Verge3D User Manual - Soft8Soft
Description: Learn how to use Interpolant in your interactive 3D apps made with Verge3D

# Interpolant

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.

## Constructor

### Interpolant(parameterPositions : Array | TypedArray, sampleValues : Array | TypedArray, sampleSize : Integer, resultBuffer : Array | TypedArray)

- parameterPositions — array of positions.
- sampleValues — array of samples.
- sampleSize — number of samples.
- resultBuffer — buffer to store the interpolation results.

This constructor is designed to be called via subclass, not directly.

## Properties

### # .parameterPositions : Array

Array of positions.

### # .resultBuffer : Array

Array to store interpolation results.

### # .sampleValues : Array

Array of samples.

### # .settings : Object

Optional, subclass-specific settings structure.

### # .valueSize : Integer

Number of samples.

## Methods

### # .evaluate(t : Float) → Array

Evaluate the interpolant at position `t`.

## Source

For more info on how to obtain the source code of this module see this page.