Skip to main content

evaluate

function evaluate(ps: number[][]): (t: number) => number[]
function evaluate(ps: number[][], t: number): number[]

Defined in local-properties-at-t/evaluate/double/evaluate.ts:24

Returns the resulting point of evaluating the given bezier curve at the given parameter t.

  • uses power bases conversion and subsequently Horner's Method to evaluate the polynomial in double precision floating point arithmetic.
  • curried: if t is omitted a function of t is returned instead (the power basis conversion is then only done once which is much faster if the curve is to be evaluated at many t values)

The resulting point p is returned as the pair [x,y], where x and y are double precision floating point numbers.

Note!
Green circles are draggable!
0

Parameters:​

NameTypeDescription
psnumber[][]an order 1, 2 or 3 bezier curve, e.g. [[0,0],[1,1],[2,1],[2,0]]
t?numberthe parameter value where the bezier should be evaluated (may be omitted, see above)