douglasPeucker algorithm