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:
xList

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.

yList

List of y coordinates of the vertices. Must be of the same length as x.

clockwisebool

If True the polygon is oriented clockwise, if False it is oriented counterclockwise. Default is True.

Returns:
List of List

Lists of oriented vertices.