research/lab/rs/roulette-cover

1 directory and 2 files in research/lab/rs/roulette-cover.

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 covered is its share of the disc.
  • The disc is the track's centre, the radius rho + max d no curve leaves and the radius min abs(rho - d) no curve enters, rho the centre circle's radius and d a 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 of rho each keep their own inner radius. A trace of 200001 points per curve meets both radii on all 48 cases, worst gap 3.55e-15.
  • The instrument is mrlynum::spirograph::cover on 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 form areas, 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 annulus 4 rho d / (rho + d)^2, which is 4 d (a - b) b / (a - b + b d)^2 inside, and the sum of the enclosed areas over the disc's area.
  • The cases are one pencil at every wheel ratio a/b in lowest terms with 1 <= b <= 4 and b < a <= 9, inside and outside; two and four quarter-turn copies of one seat at 7/3 and 5/2 inside; and the carpet's fills and corners at 7/3 and 5/2 inside and 5/8 outside, 48 in all, every one at reach 0.9 wheel 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 d and min abs(rho - d) with worst gap 3.55e-15, including the five inside ratios whose seat sits past rho, 3/2, 4/3, 5/3, 5/4, 7/4, where the inner radius is d - rho and not rho - d: one pencil at 5/4 reads radius 4.600000 and hole 2.600000.
  • The winding: on all 48 cases at all four sides the scanline mean meets the closed form, worst gap 1.73e-3 at the carpet's corners outside 5/8 at side 256, worst gap at side 2048 4.84e-4 on the same case, and no reading outside the perimeter bound. At side 2048: 0.282984 against 0.282996 for one pencil inside 3/1, 1.678772 against 1.678770 for four quarter-turn copies inside 7/3, 9.103089 against 9.103448 for the carpet's fills inside 7/3.
  • The simple curve: at b = 1 and 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.001866 inside 3/1, and extrapolates to at most 0.000124 in absolute value over the 16 ratios 2/1 to 9/1 inside 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)^2 to 8.70e-5 at worst over the same 16, 0.282998 against 0.282996 inside 3/1 and 0.801268 against 0.801333 outside 3/1, where the inside form would read 0.531445 and miss by 0.270.
  • The cover: the carpet's fills inside 7/3 cover 0.800044 on a bar of 0.000343, the ladder falling 0.814487, 0.807142, 0.803764, 0.801904 with the wall's own share falling 0.269255 to 0.038857; its corners cover 0.765594, four quarter-turn copies cover 0.629299, two cover 0.443227 and one pencil covers 0.273092. Outside 5/8 the carpet's fills cover 0.758414 and its corners 0.867284.
  • The ladder: successive differences fall by a factor of at most 0.626 on every case and both steps, which is the pixel law the Richardson limit rests on; the largest bar over the 48 is 0.000354.
  • The hole: the centre flood holds its inscribed disc on all 48 cases with no leak, the slack running from 0.000111 at four copies inside 7/3 to 0.461499 at one pencil outside 2/1, and to 0.142005 at one pencil inside 4/1 over the inside cases alone.
  • The candidates: 0 of 144 readings survive ten bars. The annulus overshoots the carpet's fills inside 7/3 by 0.0561 and one pencil inside 2/1 by 0.99721; the sum of enclosed areas reads 9.103448 against a cover that cannot pass 1; the single curve's form misses every cover, reading 0.282996 inside 3/1 where the cover is the wall alone and 0.139898 against 0.273092 for one pencil inside 7/3.
  • The collapse: two half-turn copies inside 5/2 are one curve under the coincidence law and read the same cover 0.213852 as the single pencil, while inside 7/3 they are two curves and read 0.443227.
  • mrlynum::spirograph::cover, disc, signed_area, representatives, point and track are the only outside calls; the crate tests are the_simple_curve_holds_its_whole_inside_in_the_hole, the_disc_reads_the_innermost_curve_and_not_the_farthest_seat and the_mean_winding_is_the_signed_areas_over_the_disc.