Skip to main content

true_point_fractions

Function true_point_fractions 

Source
pub fn true_point_fractions(i: usize, intervals: usize) -> &'static [(i64, i64)]
Expand description

Where, within interval i of intervals between consecutive samples, a caller of interpolate_enclosing should locate its true points: these fractions of the way from one sample to the next.

One point, in the middle, for an interior interval — that is where a cubic interpolant’s drift peaks, and it keeps the extra work at one projection per interval. The two end intervals get seven, at eighths: next to a clamped end the drift is lopsided and several times larger than inside, so it sets the width of the whole enclosure, and its peak lies wherever the end conditions put it. Measured at quarters, a smooth hump can peak between the points by ~10% of its height: on a traced plane × cylinder branch that left the branch 1.36e-8 from its curve, widened to 1.25e-8 (see cylinder_joined_over_a_hole in geop-cad-base). At eighths the shortfall is ~2%, and on a circle sampled in 8 intervals a single midpoint there left a true point unenclosed.