• 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.

    Parameters

    • points: readonly Point2D[]
    • epsilon: number

    Returns Point2D[]