pub trait ParamCurveArclen: ParamCurve {
    // Required method
    fn arclen(&self, accuracy: f64) -> f64;

    // Provided method
    fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64 { ... }
}
Expand description

A parametrized curve that can have its arc length measured.

Required Methods§

source

fn arclen(&self, accuracy: f64) -> f64

The arc length of the curve.

The result is accurate to the given accuracy (subject to roundoff errors for ridiculously low values). Compute time may vary with accuracy, if the curve needs to be subdivided.

Provided Methods§

source

fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64

Solve for the parameter that has the given arc length from the start.

This implementation uses the IPT method, as provided by common::solve_itp. This is as robust as bisection but typically converges faster. In addition, the method takes care to compute arc lengths of increasingly smaller segments of the curve, as that is likely faster than repeatedly computing the arc length of the segment starting at t=0.

Implementors§