UNPKG

toosoon-utils

Version:
29 lines (28 loc) 735 B
import type { Point2 } from '../../types'; import { Vector2 } from '../geometry'; import Curve from './Curve'; /** * Utility class for manipulating polylines * * @exports * @class PolylineCurve * @extends Curve */ export default class PolylineCurve extends Curve<Vector2> { readonly type: string; /** * Array of points defining the curve */ points: Point2[]; /** * @param {Point2[]} [points] Array of points defining the curve */ constructor(points?: Point2[]); /** * Interpolate a point on this curve * * @param {number} t Normalized time value to interpolate * @returns {Vector2} Interpolated coordinates on this curve */ getPoint(t: number): Vector2; }