Category Haskell

Calculating the reflect-rotate-translate normal form for an isometry of the plane in Haskell, and verifying it with QuickCheck.

Any isometry of the plane has a unique normal form as the composition of a translation, rotation and reflection. This note computes this normal form and tests the implementation using the QuickCheck automated testing tool for Haskell. To generate random test data, I use another characterization of isometries as products of up to three reflections. […]

Visualizing 2D convex hull using Gtk and OpenGL in Haskell

This note shows how to use OpenGL with Gtk in Haskell. The result is a little visualization to check our implementation of the classic iterative convex hull algorithm. This post is a valid literate Haskell file so save it to something like ConvexHull.lhs and compile with ghc –make ConvexHull. What you see above is what […]