Class: DefInterpolate

algeobra~DefInterpolate(topt)

Definition of a linear interpolation between two objects of the same type by some parameter t. Supported types are (type of interpolation in brackets): TYPE_NUMBER (value) TYPE_POINT (coordinates) TYPE_VECTOR (coordinates and reference point) TYPE_POLAR (coordinates) TYPE_ANGLE (angle, start and reference point) TYPE_ARC (center, radius, start angle, end angle) TYPE_ELLIPSE (center, eccentricities, start angle, end angle, rotation) TYPE_LINE (points, Opennness is determined by logical OR) TYPE_LINE_STRIP (points) TYPE_POLYGON (points) TYPE_BEZIER (points) TYPE_BEZIER_SPLINE (points)

Constructor

new DefInterpolate(topt)

Default value
Parameters:
Name Type Attributes Default Description
t Number <optional>
0.5
Source:

Methods

compute(info) → {Object}

Compute the interpolation
Parameters:
Name Type Description
info CreateInfo The creation info
Source:
Returns:
The interpolated object
Type
Object

(static) fromAngle(angle, topt) → {CreateInfo}

Compute the interpolation of an angle The interpolation interpolates from start to start + value
Parameters:
Name Type Attributes Description
angle Number | Object Either the index or value of a TYPE_ANGLE. The angle to be interpolated
t Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The interpolation parameter in [0,1]
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromObjects(obj0, obj1, topt) → {CreateInfo}

Compute the interpolation of two objects
Parameters:
Name Type Attributes Description
obj0 Number | Object Either the index or value of an object
obj1 Number | Object Either the index or value of an object
t Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The interpolation parameter in [0,1]
Source:
Returns:
The creation info
Type
CreateInfo