Skip to content
Prev 11198 / 29559 Next

minimum area bounding rectangles

On Tue, Mar 15, 2011 at 4:37 PM, Murray Richardson
<murray_richardson at carleton.ca> wrote:
Do you mean you've not found code for it or not found and implemented
an algorithm for it?

 There's a proof that the minimum area bounding rectangle of a convex
polygon will have one side along a side of the polygon, so the
algorithm involves N rotations of the polygon and computation of the
area of the axis-aligned bounding box after rotation. Choose the
rotation that minimises this.

 In R, chull will get you the convex hull, atan2 will get you the
angles, and sines and cosines will get you a rotation matrix. There's
some matlab code here:

http://www.mathworks.com/matlabcentral/fileexchange/13624-minimal-bounding-rectangle

 which might be useful.

Barry