Skip to main content

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!
0

Parameters:

NameTypeDefault valueDescription
psnumber[][]-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]]
maxCurvinessnumber0.4optional 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
gaussOrder4 | 16 | 6416the optional order of the Gaussian Quadrature performed between curve segments; defaults to 16; can be 4,16 or 64