This is the code unmodified.

Originally found at from http://www.cs.cmu.edu/~quake/triangle.html