fvcaputo / euclideanhaskell

Functional programming interface for euclidean constructions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

euclideanhaskell

Functional programming interface for euclidean constructions or: How to make cool drawings pretending to have only a ruler and compass.

Screenshots

This is a project I worked on while learning functional programming using Haskell. It was inspired by Harry Mairson's paper "Functional Geometry and the Traité de Lutherie" (check the references below). Essentially here I'm using functional programming to recreate compass and straightedge constructions. Haskell provides us with a very powerful way to abstract many details of the drawing process, allowing us to create simple and clear description of what we are interested in building.

Screenshots

Compiling the code

You will need

You can simply compile the code using the usual GHC command, for instance:

$ ghc -o Spades Spades.hs 

Files

  • Help.hs: Here is where all the functions used to draw are.
  • Amati.hs: Draws the Amati violin.
  • Hexagon.hs: Draws a hexagon.
  • Lute.hs: Draws a lute.
  • Pentagon.hs and Pentagon2.hs: Two different ways of drawing a pentagon.
  • Spades.hs: Draws the spades card suit.

References

Harry George Mairson. 2013. Functional geometry and the Traité de Lutherie: functional pearl. In Proceedings of the 18th ACM SIGPLAN international conference on Functional programming (ICFP '13). ACM, New York, NY, USA, 123-132.

About

Functional programming interface for euclidean constructions.


Languages

Language:Haskell 100.0%