pub fn approximate_polygon_dp<T>( curve: &[Point<T>], epsilon: f64, closed: bool, ) -> Vec<Point<T>>where T: NumCast + Copy,
Approximates a polygon using the Douglas–Peucker algorithm.