PiecewiseFunction

PiecewiseFunction()

The PiecewiseFunction class represents a one-time piecewise function.

Methods

addPoint()

Add the x and corresponding y coordinates of a piecewise point of the piecewise function.

getRange()

Returns the value range of x for the piecewise function.

getSize()

Returns the number of segmentation points of the piecewise function.

getTable()

Discretize the y of the piecewise function and fill it into an array. Among them, xStart and xEnd are the start and end positions of the x values ​​on the piecewise function. size is the size of the array to fill. table is an output item, of type Float32Array, which is the array to be filled.

getValue()

Get the x-to-y value on the piecewise function.

removeAllPoints()

Removes all piecewise points of the piecewise function.

removePoint()

Remove the piecewise point at the x position of the piecewise function.