Skip to main content

Module arclen

Module arclen 

Source
Expand description

Arc lengths of path segments, from + - * / and sqrt alone.

kurbo’s arc length calls powi and powf, which are the platform’s math library when kurbo’s std is on; these integrate the speed with a fixed 16-point Gauss-Legendre rule, halving a segment while the halves disagree with the whole, so the result is the same bits everywhere.

Constants§

ACCURACY
How close an arc length is computed, in pixels: the halving stops once the halves agree with the whole within this.

Functions§

length
The length of the whole of segment.
length_between
The length of segment between parameters t0 and t1.
parameter_at
The parameter at which segment has run distance of its total length (which length gave), within ACCURACY; 0 or 1 past its ends.
point_at
The point at parameter t, as kurbo evaluates it (Bernstein form, + - * only).