Algorithms and Programming Tutorials

Discover code snippets, tutorials, and programming insights

Algorithm Visualizations

Delaunay triangulation by edge legalization: Examples & Code

Delaunay triangulation by edge legalization: Triangulate the convex hull, insert remaining sites, and flip an interior edge when its opposite site lies…

Algorithm Visualizations

Voronoi cells by bisector clipping: Examples & Code

Voronoi cells by bisector clipping: Clip a fixed bounding box by each competing site’s nearest-point half-plane to construct bounded Euclidean Voronoi cells.…

Algorithm Visualizations

Sutherland–Hodgman convex polygon clipping: Examples & Code

Sutherland–Hodgman convex polygon clipping: Intersect two strictly convex polygons by clipping the subject against one oriented clip edge at a time. Explore a…

Algorithm Visualizations

Seeded simulated annealing on a Rastrigin grid: Examples & Code

Seeded simulated annealing on a Rastrigin grid: Explore the quarter-unit grid of a Rastrigin landscape. Accept improvements and probabilistically accept…

Algorithm Visualizations

Gradient descent on a quadratic surface: Examples & Code

Gradient descent on a quadratic surface: Follow the negative gradient of f(x,y)=(x-a)^2+(y-b)^2, with a stated learning rate, gradient tolerance and iteration…