code: public function getReverse(): Polygon
      {
          $reversed = new static();
  
          foreach (array_reverse($this->points) as $point) {
              $reversed->addPoint($point);
          }
  
          return $reversed;
      }
docs: Create a new polygon with reversed order of points, i. e. reversed
  polygon direction.
  
  @return Polygon