code: func DouglasPeucker(path *geo.Path, threshold float64) *geo.Path {
  	if path.Length() <= 2 {
  		return path.Clone()
  	}
  
  	mask := make([]byte, path.Length())
  	mask[0] = 1
  	mask[path.Length()-1] = 1
  
  	points := path.Points()
  
  	found := dpWorker(points, threshold, mask)
  	newPoints := make([]geo.Point, 0, found)
  
  	for i, v := range mask {
  		if v == 1 {
  			newPoints = append(newPoints, points[i])
  		}
  	}
  
  	return (&geo.Path{}).SetPoints(newPoints)
  }
docs: // DouglasPeucker simplifies the path using the Douglas Peucker method.
  // Returns a new path and DOES NOT modify the original.