Standard recursive Douglas-Peucker simplification of an open
polyline. Returns a fresh array; never mutates the input.
Drops every vertex whose perpendicular distance from the
straight chord between the current endpoints is below
epsilon. Endpoints are always preserved.
For a closed loop, see douglasPeuckerClosed2D, which
picks a stable diametric anchor pair instead of starting from
an arbitrary vertex.
Standard recursive Douglas-Peucker simplification of an open polyline. Returns a fresh array; never mutates the input.
Drops every vertex whose perpendicular distance from the straight chord between the current endpoints is below
epsilon. Endpoints are always preserved.For a closed loop, see douglasPeuckerClosed2D, which picks a stable diametric anchor pair instead of starting from an arbitrary vertex.