• Ramer-Douglas-Peucker thinning. Keeps the first and last points and, between them, only those that pull the stroke more than epsilonPx away from the chord of their kept neighbours; every dropped point lies within epsilonPx of the returned polyline. Kept points come back at their exact input coordinates, in input order. An epsilonPx that is not positive returns a copy. The result never aliases its input, so a caller may mutate it.

    Parameters

    Returns ScreenPoint[]