mirror of
https://github.com/storytold/cadcraft.git
synced 2026-10-24 19:06:56 -06:00
AREA's Object option reported a full ellipse's perimeter with Ramanujan's closed-form estimate, which falls short as the ellipse flattens: 46.0256 for a 10 x 4 ellipse (exactly 46.0262), 39.8741 for a 10 x 0.1 one (exactly 40.0110, 0.34% short). It now integrates the perimeter with the geometry crate's ellipse arc length, the one LENGTHEN measures with, so both report the same length for the same ellipse. Ellipse::arc_length_from halves a panel where it needs it (the same adaptive Gauss-Legendre as spline arc lengths): with fixed panels a 100:1 ellipse came out 4e-8 long, as it turns sharply at its ends. Tests check four ellipses (round to 100:1) against the arithmetic-geometric mean to 1e-9, and the printed AREA line. Co-authored-by: Brandon Thomas <echelon@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>