Polyline simplification for HTML5 canvas in Coffeescript For more information on the algorithm, please go here.