code: public function simplify(Polyline $polyline): Polyline
      {
          $resultPolyline = new Polyline();
          $simplifiedLine = $this->douglasPeucker($polyline->getPoints());
  
          foreach ($simplifiedLine as $point) {
              $resultPolyline->addPoint($point);
          }
  
          return $resultPolyline;
      }
docs: @param Polyline $polyline
  
  @return Polyline