MATT JONES HOME ABOUT PORTFOLIO 1CALENDAR
▾SOFTWARE
2LLMADNESS 3CRY WOLF 4BOX SCORE 5THE BULLZEN 6WINDHOVER
▾BASEBALL
7MAGIC NUMBER 8BLACK INK 9SCOUTING REPORT
A circle-vs-polygon geofencing sandbox · live geometry · no map tiles, no libraries

CRY WOLF

11:47:00 AMsim clock

Circle geofences fire arrival events from the freeway. Polygon fences fire at the property line. Run a truck past a distribution center and read the event log — the circle cries wolf, the polygon stays quiet.

1 · pick a route   2 · press run   3 · read the log  ·  between runs: drag the green corners or the amber radius

SEC. 12 — HARRIS CO. (FICTIONAL PLAT) 100 m ═ · N ↑ · fences are editable between runs
TRUCK
off property
CIRCLE
outside
POLYGON
outside
polygon fence circle fence property line (truth) truck ping
EVENT LOG
— pick a route and press run —
SCOREBOARD — WHAT EACH FENCE REPORTED VS WHAT HAPPENED
ACTUALPOLYGONCIRCLE
ARRIVAL———
DEPARTURE———
DWELL———
FALSE EVENTS———
Run a route to compare what each fence reports against what actually happened. A "false event" is a fence visit during which the truck never touched the property.
CONTROLS
ROUTE
SPEED
FENCES
RADIUS 320 m

UNDER THE HOOD

Polygon test — ray casting

Cast a ray from the truck's GPS ping to the edge of the map and count how many fence edges it crosses. odd = inside, even = outside. It's O(n) per ping and works for any shape — including boundaries with notches, easements, and a neighbor's driveway carved out. Flip on "show the math" and watch the crossings while the truck moves.

Circle test — one distance check

Measure the ping's distance to the fence center and compare it to the radius: d < r = inside. On a real globe that distance comes from the haversine formula on lat/lon; this sandbox projects everything onto a flat local plane in meters first — which is exactly what production geofence engines do before testing millions of pings.

Why anyone cares

A fence that fires from the freeway inflates dwell time, corrupts detention data, and buries dispatchers in alerts they learn to ignore. Shrinking the radius doesn't fix it — it just trades false arrivals for missed ones (try the slider). The fix is a boundary that follows the property line. And a hand-drawn polygon is only as good as the hand that drew it — drag a green corner into the freeway and watch it start lying too.

Scale: 1 unit = 1 meter on a local planar projection anchored at 29.7215° N, 95.2810° W (Houston's East End — the plat is fictional). Exports convert back to WGS-84 lat/lon. No libraries, no map tiles: one HTML file and math from scratch.

A weekend build by Matt Jones · Houston, TX · mscottjones24@gmail.com · LinkedIn — sibling of Windhover, the geofence QA/QC simulator.
0

Matt Jones, 2026

mscottjones24@gmail.com