Skip to main content

eval-de-casteljau-with-err

function evalDeCasteljauWithErr(ps: number[][], t: number): object

Defined in local-properties-at-t/evaluate/double/eval-de-casteljau-with-err.ts:28

Returns the resulting point of evaluating the given bezier curve at the given parameter t including a coordinate-wise error bound.

The resulting point is returned as { p: number[], pE: number[] }, where p is the point [x,y] and pE is the corresponding coordinate-wise absolute error bound of the calculation.

Note!
Green circles are draggable!
Example
evalDeCasteljauWithErr([[1, 1], [7, 7], [4, 2], [8, 1.5]], 0.4)//=> { p: [4.904, 3.912], pE: [2.2390089782220466e-14, 2.0631496511214218e-14] }

Parameters:

NameTypeDescription
psnumber[][]an order 1,2 or 3 bezier curve, e.g. [[0,0],[1,1],[2,1],[2,0]]
tnumberthe parameter value where the bezier should be evaluated

Returns: object

NameType
pnumber[]
pEnumber[]