How to rotate a polygon
2 visualizaciones (últimos 30 días)
Walter Roberson el 15 de Mayo de 2015
To find the minimum area bounded by a rectangle for the polygon, start by finding the furthest distance between any two points on the polygon. The pair of points with the furthest distance forms one axis of a bounding rectangle. Rotate the polygon so that the pair is along the vertical axis, and then the distance between the maximum and minimum horizontal axis results will give you the length of the smaller side.
There might be a nice vector algebra way of doing this; I don't know.
The MajorAxisLength and MinorAxisLength of regionprops() might help.