Examples#

This gallery walks through every public feature of mathematicskit.geometry: convex hull, Delaunay triangulation/Voronoi diagrams, segment intersection/point-in-polygon, polygon area/centroid, and the Frenet-Serret frame.

Each script in this gallery is self-contained and can be run directly with python examples/geometry/<section>/<script>.py.

Sections#

  • convex_hull – Graham’s scan, checked against scipy’s Qhull.

  • triangulation – Voronoi diagrams and Delaunay triangulation.

  • intersections – ray-casting point-in-polygon and the Jordan curve theorem.

  • polygon – Euclid’s equal areas, Heron’s formula, and Pick’s theorem.

  • curves – curvature, arc length, and the Frenet-Serret frame.

Bézier curves#

Curves built from control points by repeated linear interpolation.

De Casteljau’s algorithm and Bézier curves

De Casteljau's algorithm and Bézier curves

Convex hull#

Graham’s angular-sweep convex hull, checked against scipy’s Qhull.

Graham’s scan: the convex hull by an angular sweep

Graham's scan: the convex hull by an angular sweep

Curves and the Frenet-Serret frame#

Curvature, arc length, and the moving frame along a parametric curve.

The Frenet-Serret frame of a circular helix

The Frenet-Serret frame of a circular helix

Distances between shapes#

The Hausdorff distance between point sets.

The Hausdorff distance between shapes

The Hausdorff distance between shapes

Enclosing circles#

The smallest circle containing a set of points.

Sylvester’s problem: the smallest enclosing circle

Sylvester's problem: the smallest enclosing circle

Point-in-polygon#

Ray casting and the Jordan curve theorem, with crossings found by segment intersection.

The Jordan curve theorem and ray casting: inside or outside?

The Jordan curve theorem and ray casting: inside or outside?

Polygon area#

Euclid’s equal areas, Heron’s formula, and Pick’s theorem, all checked against the shoelace formula.

Euclid’s Elements, Book I: equal areas between parallels

Euclid's Elements, Book I: equal areas between parallels

Heron’s formula and needle-like triangles

Heron's formula and needle-like triangles

Pick’s theorem: area from lattice points

Pick's theorem: area from lattice points

Polyhedra#

Vertex, edge, and face counts of convex polyhedra, and Euler’s formula.

Euler’s polyhedron formula: V - E + F = 2

Euler's polyhedron formula: V - E + F = 2

Proximity#

The closest pair of points by divide and conquer.

Shamos and Hoey: the closest pair of points

Shamos and Hoey: the closest pair of points

Line simplification#

Reducing the number of vertices of a polyline within a tolerance.

Douglas-Peucker line simplification

Douglas-Peucker line simplification

Surfaces#

Gaussian and mean curvature of parametric surfaces.

Gauss’s Theorema Egregium: curvature you can measure from inside

Gauss's Theorema Egregium: curvature you can measure from inside

Voronoi diagrams and Delaunay triangulation#

Nearest-site partitions and empty-circumcircle triangulations, both via scipy’s Qhull wrapper.

Voronoi diagrams: every location goes to its nearest site

Voronoi diagrams: every location goes to its nearest site

Delaunay triangulation: empty circumcircles and fat triangles

Delaunay triangulation: empty circumcircles and fat triangles

Gallery generated by Sphinx-Gallery