cubic-to-quadratic
function cubicToQuadratic(ps: number[][], preserveTangents?: boolean): number[][] | undefined
Defined in transformation/degree-or-type/cubic-to-quadratic.ts:30
Returns a quadratic approximation to the given cubic bezier curve.
the initial and final control points of the resulting bezier coincide with that of the curve being approximated
if
preserveTangents
istrue
and the cubic's initial and final tangents are parallel (and not coincident) thenundefined
is returned
Note!
Green circles are draggable!
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
ps | number[][] | - | a cubic bezier curve given as an ordered array of its control point coordinates, e.g. [[0,0], [1,1], [2,1], [2,0]] |
preserveTangents | boolean | false | optional; defaults to false ; if true then the approximation must also preserve the tangents of the cubic at the initial and final control points |