Is that phone inside the delivery zone? The ray-casting test answers instantly — shoot a ray, count the crossings, and odd means inside.
Point in Polygon (Geofence)Live
ray-casting containment
Controls
Is a point inside a shape? The ray-casting algorithm shoots a ray from the point in any direction and counts how many polygon edges it crosses: an odd number means inside, an even number means outside. It is the math behind geofencing — triggering an alert when a phone or vehicle enters or leaves a region — and behind hit-testing in graphics. Drag the point, or click anywhere to move it there.
Reading this result: A ray fired from this point crosses the polygon boundary an odd number of times, so the point lies inside the region — a geofence here would fire.
Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.
★ Sign in to save this setupSave your tuned setup, or drop this simulation into your own site, docs, or course page.
How it works
The point-in-polygon test casts a ray from the point in any direction and counts how many polygon edges it crosses. An odd count means the point is inside, an even count outside — a beautifully simple result of topology. It powers geofencing (alerting when a device enters or leaves a region), map region selection, and hit-testing in graphics. Click to move the test point.
✦
Ask the AI about this model
The math, the assumptions, real-world uses, or a code translation — explained for this exact simulation.
Is this point in polygon ray casting tool really free?▾
Yes. Point in Polygon (Geofence) runs entirely in your browser using your device's own compute, so local use is free forever. You only pay Compute Tokens if you scale a job to the cloud.
Do I need to install anything?▾
No. Everything runs client-side in a modern browser — no downloads, no license, no account required to start.
Can I save or share my simulation?▾
Create a free account to save projects, and use a shareable embed or minted DOI to publish a live, interactive version anywhere.
How accurate are the results?▾
The solver uses established numerical methods, but results are for research and educational purposes and should be validated against experiment or professional review before you rely on them.