orient_polygon#
- static GeometryOperators.orient_polygon(x, y, clockwise=True)[source]#
Orient a polygon clockwise or counterclockwise. The vertices should be already ordered either way. Use this function to change the orientation. The polygon is represented by its vertices coordinates.
- Parameters:
- x
List
List of x coordinates of the vertices. Length must be >= 1. Degenerate polygon with only 2 points is also accepted, in this case the points are returned unchanged.
- y
List
List of y coordinates of the vertices. Must be of the same length as x.
- clockwisebool
If
True
the polygon is oriented clockwise, ifFalse
it is oriented counterclockwise. Default isTrue
.
- x
- Returns:
List
of
List
Lists of oriented vertices.