silly-demos
Small geometry and simulation sketches. The math runs in Rust compiled to WebAssembly; the browser only draws.
- Boids A flock that emerges from three local steering rules: keep your distance, match heading, stay together.
BoidsSim::step - Clustering lab Points arrive one at a time and two methods find the clusters as they come, without being told how many: balls that spawn, merge, split and fade, and a sketch refined by ball k-means.
ClusterLab::step - Collision lab Pick two shapes and compare the collision tests that fit them: clamping, separating axes, GJK and EPA, with their costs.
CollisionLab::run - Inverse kinematics A jointed arm reaching for a target, solved with FABRIK, CCD or the Jacobian, with the error and iterations each needs.
IkChain::solve - Kohonen maps Self-organizing maps that sort colors into a palette, map the world’s countries by ten indicators from 1992 to 2022, and unfold over a density you paint.
SomData::step - Point to segment The shortest distance from a point to a line segment, and which side of the line the point is on.
GeometryTests::point_line_test - Rover exploration A rover with a laser scanner maps a floor plan it has never seen, clearing the fog of war frontier by frontier, then drives home.
RoverLab::step - Voronoi / Delaunay Moving points with their Delaunay triangulation and the Voronoi diagram it implies.
VoronoiTests::voronoi_edges