total-length
function totalLength(ps: number[][], maxCurviness?: number, gaussOrder?: 4 | 16 | 64): number
Defined in global-properties/length/total-length.ts:21
Returns the curve (a linear, quadratic or cubic bezier curve) length in the specified interval calculated using Gaussian Quadrature with adaptive subdivision for improved accuracy.
Note!
Green circles are draggable!
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
ps | number[][] | - | an order 0,1,2 or 3 bezier curve given as an array of its control points, e.g. [[1,2],[3,4],[5,6],[7,8]] |
maxCurviness | number | 0.4 | optional maximum 'curviness' (defined as the total angle change between consecutive line segments between the curve control points) before subdivision occurs; defaults to 0.4 radians |
gaussOrder | 4 | 16 | 64 | 16 | the optional order of the Gaussian Quadrature performed between curve segments; defaults to 16; can be 4,16 or 64 |