src/Polygon.php
public function getReverse(): Polygon
    {
        $reversed = new static();

        foreach (array_reverse($this->points) as $point) {
            $reversed->addPoint($point);
        }

        return $reversed;
    }
public function getReverse(): Polygon
    {
        $reversed = new static();

        foreach (array_reverse($this->points) as $point) {
            $reversed->addPoint($point);
        }

        return $reversed;
    }
Create a new polygon with reversed order of points, i. e. reversed
polygon direction.

@return Polygon