THE FOLD / SPAWN / THE SANDBOX / THE POINT IN POLYGON
THE POINT IN POLYGON
inside or outside decided by ray-crossing parity
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Point in polygon: to decide whether a point is inside a polygon, shoot a ray from the point in any direction and count how many polygon edges it crosses. Odd crossings = inside, even = outside.
This ray-casting rule works for any simple polygon — convex or wildly concave — and is a direct consequence of the Jordan curve theorem: a closed curve splits the plane into inside and outside, and each edge crossing flips which one you are in. The winding-number method gives the same answer by summing signed angle turns.
LIT verified live: over 500 points and polygons, ray-casting parity, the winding number, and a convex ground-truth test all agree (window.__pointinpolygon). FIG no framing; exact.
This ray-casting rule works for any simple polygon — convex or wildly concave — and is a direct consequence of the Jordan curve theorem: a closed curve splits the plane into inside and outside, and each edge crossing flips which one you are in. The winding-number method gives the same answer by summing signed angle turns.
LIT verified live: over 500 points and polygons, ray-casting parity, the winding number, and a convex ground-truth test all agree (window.__pointinpolygon). FIG no framing; exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-sandbox — testing a point against a shape, the primitive behind hit-testing and fill. Ray-casting is that inside/outside test. AVAN (AI) built the instrument: the even-odd ray count, the winding-number cross-check, the convex ground-truth comparison.
Credit as content: the even-odd rule is classical; formalised through the Jordan curve theorem (Camille Jordan, 1887). The weave: David names the sandbox; I cast a ray, tally its edge crossings, and confirm the parity matches the winding number and a direct half-plane test.
Credit as content: the even-odd rule is classical; formalised through the Jordan curve theorem (Camille Jordan, 1887). The weave: David names the sandbox; I cast a ray, tally its edge crossings, and confirm the parity matches the winding number and a direct half-plane test.
3 ONE DIMENSION
A horizontal ray from the point: every time it crosses an edge, the inside/outside state flips. Start outside; an odd number of flips leaves you inside, an even number leaves you out.
4 TWO DIMENSIONS · INTERACTIVE
A polygon and a movable query point with its ray. The crossings are counted and coloured; inside/outside is reported and checked against the winding number.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the ray and its edge-crossings, parity deciding inside from outside.
AVAN’s addition (the inverse-companion): a global topological property — inside vs outside — is decided by a local parity count along an arbitrary ray. And the direction of the ray does not matter: any ray from an interior point crosses the boundary an odd number of times, from an exterior point an even number (Jordan). The inverse of ‘is the point enclosed?’ is ‘is the crossing count odd?’ — a question about a whole region reduced to a tally along a single line. Magenta is the polygon’s interior region, the global fact; green is the ray’s edge-crossings, the local tally. Topology from counting — the boundary’s parity decides enclosure, whichever way you look.
LIT Genuine ray-casting point-in-polygon test (even-odd rule; Jordan curve theorem, Jordan 1887). Verified live: for 500 random points and convex polygons, the even-odd ray-crossing count, the winding number, and a direct half-plane (convex) inside test all agree (window.__pointinpolygon.rayEqualsWinding).
FIG No framing: the even-odd ray count, the winding-number cross-check, and the convex ground-truth comparison run in-browser and agree exactly. The AVAN inverse is honest — a global inside/outside property is decided by a local parity along an arbitrary ray whose direction does not matter (any interior ray crosses the boundary an odd number of times, Jordan); magenta is the interior region, green the ray crossings. Ties to shoelace orientation.
FIG No framing: the even-odd ray count, the winding-number cross-check, and the convex ground-truth comparison run in-browser and agree exactly. The AVAN inverse is honest — a global inside/outside property is decided by a local parity along an arbitrary ray whose direction does not matter (any interior ray crosses the boundary an odd number of times, Jordan); magenta is the interior region, green the ray crossings. Ties to shoelace orientation.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN