Computational Geometry Toolkit
Niche but powerful 2D geometry: polygon area & centroid, point-in-polygon test, convex hull, line & circle intersection, bounding box, Bézier curve inspector, SVG path math and polyline (Douglas–Peucker) simplification — each drawn live on a canvas. For graphics, CAD, GIS and game dev.
How to Use
- Pick a tool and type points as <code>x,y</code> (one per line, or any list of numbers — they're paired up). Most tools draw the result on the canvas as you type.
- <strong>Polygon area</strong> gives the shoelace area, perimeter, centroid, orientation and bounding box; <strong>point-in-polygon</strong> tests a point with ray casting; <strong>convex hull</strong> wraps a point set.
- <strong>Line ∩ line</strong> takes two segments (<code>x1,y1 x2,y2</code> each) and finds where they cross — including the "lines meet but segments don't" case; <strong>circle ∩ circle</strong> takes <code>cx cy r</code> for each.
- The <strong>Bézier inspector</strong> takes 3 control points (quadratic) or 4 (cubic) and reports the point and tangent at t, arc length, bounding box and the start/end; the <strong>SVG path</strong> tool parses a <code>d</code> string for length, bounding box and segment count.
- <strong>Coordinate simplifier</strong> runs Douglas–Peucker on a polyline at your tolerance ε — useful for shrinking GPS tracks or vector paths.
Geometry view
Algorithms
About the Computational Geometry Toolkit
Computational Geometry Toolkit is a quick, free tool for everyday maths and number work. It works in your browser and keeps everything on your device. Niche but powerful 2D geometry: polygon area & centroid, point-in-polygon test, convex hull, line & circle intersection, bounding box, Bézier curve inspector, SVG path math and polyline (Douglas–Peucker) simplification — each drawn live on a canvas. For graphics, CAD, GIS and game dev.
How it works
Enter your figures and the result appears instantly, updating the moment you change anything. There is no submit button and nothing to wait for, so it is easy to try a few what-if numbers and compare the results. Just check each box holds the kind of value it expects.
Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.
Frequently Asked Questions
What does each tool compute?
<strong>Polygon area</strong> — the shoelace formula, plus perimeter, centroid, convexity and orientation. <strong>Point-in-polygon</strong> — ray-casting (crossing-number) inside/outside test. <strong>Convex hull</strong> — Andrew's monotone-chain algorithm. <strong>Line intersection</strong> — segment-segment crossing with the parameters t and u. <strong>Circle intersection</strong> — 0, 1 (tangent) or 2 points. <strong>Bounding box</strong> — the axis-aligned extents. <strong>Bézier inspector</strong> — point/tangent at t, arc length, bbox, de-Casteljau split. <strong>SVG path</strong> — flattened length and bbox. <strong>Simplifier</strong> — Douglas–Peucker line reduction.
How is polygon area calculated?
By the <strong>shoelace formula</strong>: area = ½·Σ(xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ) over the vertices. The signed result also tells you the winding direction — positive is counter-clockwise, negative is clockwise — and its magnitude is the true area for any simple polygon, convex or not.
What is a convex hull and why use it?
The smallest convex polygon that contains all your points — like a rubber band snapped around them. It's a building block for collision detection, shape matching, nearest-feature queries and computing widths/diameters. This tool uses the monotone-chain algorithm, which is O(n log n).
What's the difference between line and segment intersection?
Two infinite <em>lines</em> almost always cross at one point; two finite <em>segments</em> only intersect if that point lies on both. The tool reports the crossing point either way, but tells you whether it's actually on the segments (parameters t and u both between 0 and 1) — important for collision and clipping where the endpoints matter.
What can I do with the Bézier and SVG tools?
The Bézier inspector evaluates the curve at any t, gives the tangent direction, the exact arc length (numerically integrated), the tight bounding box, and can split the curve at t (de Casteljau) — handy for animation, fonts and CAD. The SVG path tool parses a real <code>d</code> attribute (M, L, H, V, C, S, Q, T, Z) and returns its length and bounding box, flattening curves to polylines.
What is the coordinate simplifier for?
The Douglas–Peucker algorithm removes points from a polyline while keeping its shape within a tolerance ε — the standard way to shrink GPS tracks, map outlines and vector graphics. A bigger ε removes more points. The tool shows the original and simplified paths and the reduction percentage.
How do I use the Computational Geometry Toolkit?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Does it cost anything or need an account?
No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.
Is anything I type uploaded?
No. The tool works entirely on your device, so the values you enter never leave your browser.
Common Use Cases
Graphics & game dev
Hit testing, hulls, intersections and Bézier curves for animation and collision.
CAD & fabrication
Areas, centroids, bounding boxes and curve math for parts and toolpaths.
GIS & mapping
Point-in-polygon containment and Douglas–Peucker track simplification.
SVG & vector art
Measure path length and bounds; split and inspect Bézier curves.
Robotics & motion
Convex hulls, intersections and geometry for planning and sensing.
Data & viz
Bounding boxes, hulls and shape stats for plotting and clustering.
Last updated: