README.md
5.9 kB · markdown
Roulette Cover
- Measures the shape a roulette walls off inside its own disc, the question the spirograph page asks, and prints only.
- Every curve is a wall. One flood starts at the raster's edge, the fluid poured from outside; one starts at the centre pixel, the fluid poured at the centre of the track. The shape is the rest of the disc, the walls and their pockets included, and
coveredis its share of the disc. - The disc is the track's centre, the radius
rho + max dno curve leaves and the radiusmin abs(rho - d)no curve enters,rhothe centre circle's radius andda seat's distance from the wheel's centre: the inner radius is the least over the seats and not the outermost seat's own, since seats on either side ofrhoeach keep their own inner radius. A trace of 200001 points per curve meets both radii on all 48 cases, worst gap3.55e-15. - The instrument is
mrlynum::spirograph::coveron rasters of side 256, 512, 1024 and 2048. A raster shape carries a boundary error of the order of the polylines' length times the pixel side, so every printed digit is the Richardson limit of the ladder under that law, with a bar from the previous rung; the wall's own share of the disc is printed beside it, since the wall is counted inside the shape and is most of what the limit removes. - The self-check is
winding, the mean signed winding number of the disc's pixel centres, read by scanline against the polylines. Its expectation is the Green's theorem closed formareas,pi b rho (rho -+ d^2/r)summed over the distinct curves and divided by the disc's area: the two share no code. It checks the polylines and the raster against Green's theorem and never the floods, which it cannot see; the floods are guarded instead by the sample spacing of at most half a pixel, which makes the wall eight-connected and a four-connected flood unable to cross it. - The candidates tested against the extrapolated cover are the single simple curve's form
rho (rho -+ d^2/r) / (rho + d)^2, the full annulus4 rho d / (rho + d)^2, which is4 d (a - b) b / (a - b + b d)^2inside, and the sum of the enclosed areas over the disc's area. - The cases are one pencil at every wheel ratio
a/bin lowest terms with1 <= b <= 4andb < a <= 9, inside and outside; two and four quarter-turn copies of one seat at7/3and5/2inside; and the carpet's fills and corners at7/3and5/2inside and5/8outside, 48 in all, every one at reach0.9wheel radii. - Every table runs on every case, and the report's lines are computed from the tables they summarise, never asserted.
RUN
CARGO_BUILD_JOBS=4 cargo run --release -p roulette-cover- About two and a half seconds; prints only, writes nothing. Peak memory is the 2048 raster, about 30 MB.
WITNESSES
- The disc: on all 48 cases the traced maximum and minimum radius meet
rho + max dandmin abs(rho - d)with worst gap3.55e-15, including the five inside ratios whose seat sits pastrho,3/2, 4/3, 5/3, 5/4, 7/4, where the inner radius isd - rhoand notrho - d: one pencil at5/4reads radius4.600000and hole2.600000. - The winding: on all 48 cases at all four sides the scanline mean meets the closed form, worst gap
1.73e-3at the carpet's corners outside5/8at side 256, worst gap at side 20484.84e-4on the same case, and no reading outside the perimeter bound. At side 2048:0.282984against0.282996for one pencil inside3/1,1.678772against1.678770for four quarter-turn copies inside7/3,9.103089against9.103448for the carpet's fills inside7/3. - The simple curve: at
b = 1and one pencil the roulette is one simple closed curve below the loop threshold on both sides, so the cover falls like the pixel,0.014844, 0.007489, 0.003762, 0.001866inside3/1, and extrapolates to at most0.000124in absolute value over the 16 ratios2/1to9/1inside and outside. - The simple curve's inside: the centre flood is the whole inside, meeting the signed form
rho (rho -+ d^2/r) / (rho + d)^2to8.70e-5at worst over the same 16,0.282998against0.282996inside3/1and0.801268against0.801333outside3/1, where the inside form would read0.531445and miss by0.270. - The cover: the carpet's fills inside
7/3cover0.800044on a bar of0.000343, the ladder falling0.814487, 0.807142, 0.803764, 0.801904with the wall's own share falling0.269255to0.038857; its corners cover0.765594, four quarter-turn copies cover0.629299, two cover0.443227and one pencil covers0.273092. Outside5/8the carpet's fills cover0.758414and its corners0.867284. - The ladder: successive differences fall by a factor of at most
0.626on every case and both steps, which is the pixel law the Richardson limit rests on; the largest bar over the 48 is0.000354. - The hole: the centre flood holds its inscribed disc on all 48 cases with no leak, the slack running from
0.000111at four copies inside7/3to0.461499at one pencil outside2/1, and to0.142005at one pencil inside4/1over the inside cases alone. - The candidates: 0 of 144 readings survive ten bars. The annulus overshoots the carpet's fills inside
7/3by0.0561and one pencil inside2/1by0.99721; the sum of enclosed areas reads9.103448against a cover that cannot pass1; the single curve's form misses every cover, reading0.282996inside3/1where the cover is the wall alone and0.139898against0.273092for one pencil inside7/3. - The collapse: two half-turn copies inside
5/2are one curve under the coincidence law and read the same cover0.213852as the single pencil, while inside7/3they are two curves and read0.443227. mrlynum::spirograph::cover,disc,signed_area,representatives,pointandtrackare the only outside calls; the crate tests arethe_simple_curve_holds_its_whole_inside_in_the_hole,the_disc_reads_the_innermost_curve_and_not_the_farthest_seatandthe_mean_winding_is_the_signed_areas_over_the_disc.