geometry.js

Computational geometry library · Interactive App

primitives predicates structural high-level delaunay voronoi
Click to place points A, B, C

Result

Place 3 points to test orientation

How to Use

Click to place points A, B, C. Drag to move them. Watch the triangle color change based on C's position relative to line AB.

Controls

Legend

Point A
Point B
Point C

Triangle Color

Left / CCW
Right / CW
Collinear
Click to create two segments

Result

Draw two segments

How to Use

Click 4 points to create two segments. Drag points to move them. The test checks if the segments intersect.

Controls

Click to draw polygon · Click to place test point · Drag to move

Result

Draw a polygon and move your mouse

How to Use

Click to draw a polygon. Close it by double-clicking or snapping to first point. Then click anywhere to place a test point. Drag the point to move it. Green = inside, Red = outside.

Controls

Click to draw polygon · Double-click or snap to first point to close

Result

Draw a polygon to test

How to Use

Click to add vertices. Double-click or snap to first point to close. Drag vertices to test different shapes. Green = simple, Red = self-intersecting.

Controls

Info

A simple polygon has no self-intersections. Draw carefully!
Click to add points

Stats

Points: 0
Hull vertices: 0

How to Use

Click to add points or use +10 random. The purple polygon shows the convex hull (smallest convex shape containing all points).

Controls

Click to draw polygon vertices

Stats

Vertices: 0
Edges: 0

How to Use

Draw a polygon. Dotted green lines show internal visibility. Hover over vertices to see which other vertices are visible from it.

Controls

Info

Shows which vertices can "see" each other inside the polygon

💡 Hover over a vertex to highlight its visibility

Vertex Colors

Active (hover)
Visible
Not visible
Click to draw polygon · Double-click or snap to first point to close

Stats

Triangles: 0
Area:

How to Use

Click to draw a polygon. Close it by double-clicking or snapping to the first point. The polygon will be decomposed into triangles.

Controls

Click to add points · Drag to move

Stats

Points: 0
Triangles:

How to Use

Click to add points. Drag to move them. The triangulation maximizes minimum angles, avoiding thin triangles.

Controls

Click to add sites · Drag to move

Stats

Sites: 0
Cells:

How to Use

Click to add sites. Each colored cell contains all points closest to that site. Drag sites to see cells update dynamically.

Controls