quadratic-to-polyline
function quadraticToPolyline(ps: number[][], tolerance?: undefined | number): number[][]
Defined in fit/quadratic-to-polyline.ts:31
Transforms the given quadratic bezier curve into a polyline approximation to within a given tolerance and returns the result.
Note!
Green circles are draggable!
Parameters:
Name | Type | Description |
---|---|---|
ps | number[][] | a quadratic bezier curve given as an ordered array of its control point coordinates, e.g. [[0,0], [1,1], [2,1], [2,0]] |
tolerance? | undefined | number | defaults to 2**-10 of the maximum coordinate of the given bezier curve; a tolerance given as the maximum Hausdorff distance allowed between the polyline and the bezier curve |