GForth Graham Scan
Project for stack-based languages
The program calculates the convex hull of a set of given points. It consists of two parts:
- A forth program that reads points from in.txt and writes the convex hull into out.txt
- A postscript program that draws the point set and the convex hull
Usage
- gforth grahamscan.fs
- gs draw.ps
File Format
Each line of the in.txt and out.txt files consists of a coordinate pair separated by a single space. The last line must always be empty.