Jack Snoeyink's implementation of the Douglas-Peucker line simplification algorithm