README.md

8.1 kB · markdown

Roulette Reaches

  • Finds the reaches at which three or four of a wheel's trochoids run through one point on a circle track, and reads them back off mrlynum::spirograph::point and mrlynum::spirograph::trace.
  • The wheel is the level-1 carpet, eight pencils on the filled cells, corner seats at modulus 2 t / 3 and edge seats at sqrt(2) t / 3 for reach t, on the circle track a/b in lowest terms, inside or outside.
  • The reduction: a pencil at complex seat p wheel radii draws z(psi) = r e^(i b psi) (A + p e^(i eps a psi)) on psi in [0, 2 pi), with A = abs(a/b + eps), eps = -1 inside and +1 outside.
  • The picture turns a fold, since z(psi + 2 pi / a) = e^(2 pi i b / a) z(psi) with no eps in the factor, and turning the seat by alpha turns the curve by -b eps alpha / a, so every curve of one seat modulus is a rotation of one master curve and the whole picture is one scalar problem.
  • The mark: writing x for the seat's phase, m(x) = 4 a (b eps x / a + arg(A + p e^(ix))) / pi with arg continuous from 0 at x = 0; the radius is strictly decreasing on [0, pi], so the curve meets every circle strictly between the two apex radii in exactly 2 a points, at the angles c + m/8 and c - m/8 in units of a turn over a, where c = -b eps arg(p) / (2 pi) is the seat's offset.
  • The offset of a carpet seat is an exact eighth: -b eps d mod 8 for the seat's compass index d, so every meeting test is integer arithmetic on the eighths and never a tolerance.
  • While the modulus is under A the mark runs from 0 at the outer apex to 4 b eps at the inner one; past A the point A + p e^(ix) circles the origin and the inner value becomes 4 b eps + 4 a instead.
  • The mark is one to one in the radius for modulus under min(1, A), and that window is sharp but for one endpoint: at modulus one the binding derivative meets its bound at the single phase x = 0 inside and at x = pi outside, so modulus one is still one to one, and every larger modulus fails. That window, not modulus under one, is what the node counts a (b - 1) and 2 a b need.
  • Two curves of one seat modulus whose offsets differ by a quarter turn, which is what a square seat orbit gives, cross only on the circles where the mark is a whole number, and a curve crosses itself only where the mark is a multiple of four; seats a fifth of a turn apart cross where the mark is plus or minus 1.2 modulo four instead.
  • Three curves of one seat modulus never meet at a point unless the modulus is A, and at A every curve of that modulus runs through the centre, a times each; the radius squared is monotone in the phase, which carries this past the one to one window.
  • An alignment reach is where both marks land on whole numbers at one radius and some eighth class collects three or more branches; the number of meeting classes is 4 / gcd(b, 4), each class holding a points.
  • Two kinds: transversal, where every curve crosses the circle, and tangential, where the edge mark sits at 0 or 4 b eps, its two branches merged, and the edge curve touches the circle at its own apex while a corner pair crosses there. Inside the window the corner band contains the edge band, so both apex radii are reachable and the tangential family is not empty.
  • The exact law a meeting obeys is w^(a + 2 b eps) (A + p w)^a = i^m (A w + p)^a on the unit circle, from abs(A + p w)^2 = (A + p w)(A w + p) / w; squaring loses half the angle, so the law pins the mark modulo four and the solver's walk pins the rest.
  • The meeting conditions are that law for each of the two moduli plus the equal radius equation, three real equations in three real unknowns over the field generated by sqrt 2. The alignment reaches are contained in that real algebraic set and do not fill it, since the law pins the mark only modulo four; the mod four branches are disjoint and closed inside the window, so an isolated alignment reach would be an isolated point of the set and hence algebraic. Nothing here certifies any reach isolated, so no reach is certified algebraic.
  • The solver walks the reach: it fixes each whole corner mark, samples the reach on a grid, and bisects the cells where the edge mark steps over a whole number. The edge mark is read through the clamped phase, so it stays continuous where the corner mark's radius leaves the edge band and the last cell before the exit is searched like any other; the band exit itself is bisected separately as the tangential event.
  • The scan runs over the window, from the reach floor mrlynum::spirograph::pencils accepts up to min(1.4999, 1.5 min(1, A)), and prints the corner modulus at both ends.
  • The proximity check is the falsification: the predicted point is computed from the algebra alone, then the least distance from it to each pencil's polyline is measured, in f64 against mrlynum::spirograph::point and in f32 against mrlynum::spirograph::trace, at growing sample counts. trace returns f32, so the study prints half an f32 step at the meeting radius beside every f32 gap; a gap under that floor measures rounding, not convergence.

RUN

  • CARGO_BUILD_JOBS=4 cargo run --release -p roulette-reaches
  • A few minutes; prints only, writes nothing, holds a few megabytes.

WITNESSES

  • The seat rotation sign, settled against mrlynum::spirograph::point on 7/3 inside at alpha = 0.3: the curve turns by -b eps alpha / a, which closes to 3.691e-15 at three phases, while +b eps alpha / a misses by 8.866e-1.
  • The reduction against mrlynum::spirograph::point over all 98 circle tracks with b in 1..8 and a in b+1..13 coprime, both sides, at reach 0.83 and 29 phases a seat: worst gap 2.138e-13; the offset classes match mrlynum::spirograph::distinct on all 98.
  • The node window: 7/5 inside at modulus 0.3900 under A = 0.4 gives b - 1 = 4 self classes and 2 b = 10 pair classes per pair, and at 0.4100 the pair count falls to 8; 4/3 inside at 0.3267 gives 2 self classes and at 0.3400 gives 1.
  • The 7/3 inside carpet has 24 alignment reaches over the scan, which on the corner seats runs from modulus 0.033333 to 0.999933: 21 transversal and 3 tangential. Every transversal meeting carries four branches, twelve of the 21 from four distinct curves and nine from three, where one curve's own self crossing lands on the meeting.
  • The transversal reach near 0.79 is 0.791009415157, marks (-6, -9), ring 1.005704332357 wheel radii, corner modulus 0.527339610104; the exact law residual is 4.18e-15 and the bracket 1.1e-16.
  • The f64 check at that reach: the four meeting seats sit 2.167e-5, 1.441e-6, 7.697e-8, 5.590e-9 from the predicted point at 2000, 8000, 32000 and 128000 samples, falling like the square of the sample count, while the other four seats stay 1.206e-1 away.
  • The same read off trace gives 2.162e-5, 1.526e-6, 1.109e-7 and then floors at 7.926e-8; half an f32 step at that radius is 1.192e-7, so only the first two columns carry the square law.
  • The control reaches 0.781009 and 0.801009 carry no class past two branches and push the four seats 1.767e-2 and 1.771e-2 from that point.
  • The drop, in classes times a: 7/3 inside carries 184 classes and so 1288 nodes at a generic reach, and 164 classes and 1148 nodes at the alignment, each meeting swallowing five double points.
  • The tangential family on 7/3 inside sits at 0.687455178256 with marks (-7, -12), 0.948942238176 with (-1, 0) and 1.176138007019 with (-5, -12); three seats pass within 1.142e-6, 1.707e-6 and 3.654e-8 of the predicted point in f64 at 8000 samples while the nearest other seat is 5.733e-2, 4.789e-1 and 5.492e-2 away.
  • The sweep over all 98 tracks inside the window: 2157 alignment reaches, 193 of them tangential; every one is read against point and trace and holds, the 1964 transversal ones also show a class past two branches in the census, and no control reach shows one. The worst f64 gap over the whole sweep is 2.445e-4, over an f32 floor of at most 9.537e-7.
  • The counts converge in the scan: 7/3 inside gives 24, 12/7 inside 153, 13/7 inside 177, 9/5 inside 89, 13/8 inside 11 and 13/7 outside 61, each at both 6000 and 24000 steps.