I’d like to cut a convex polygon into two with a given ratio of areas using a straight line, such that the larger aspect ratio of the two subpolygons is minimised.
My approach at the moment involves choosing a random starting point, computing the appropriate end point that splits the polygon into the target areas, then calculating the larger of the two aspect ratios. Then repeating this lots of times until I’m close enough to a minimum!
The aspect ratio of a polygon A is defined as:
asp(A) := diam(A)^2 / area(A)
The method I’ve been working on is very similar to Belisarius, so I’ll only share a few notes about my thinking (I’m using Mathematica).
The yellow areas mark the area were one could locate the cut:
so before doing many calculations on all combinations it’s good to mow away invalid candidates. Here is shown for some area ratios what pairs are left:
– As belisarius says you can find the range of area ratios for each of the above situations, but simply taking the Min and Max is incorrect. The two ranges you get when you reverse the two areas in your area ratio maybe disjunct. I use Mathematica’s
Intervalarithmetic to handle this for me:Checking whether a given area ratio is also handled with a comfortable Interval function:
The value of the paramater labda that determines the location of the cut through the first edge as a function of mu (the parameter that determined the position for the second edge)
\[Lambda] -> (2*aL + givenAreaRatio*(-2*aR + (p1y - p3y)*(p2x - p4x) - (p1x - p3x)*(p2y - p4y)) + (1 +
givenAreaRatio)*(p1x*p3y - p3y*p4x + p1y*(-p3x + p4x) -
p1x*p4y + p3x*p4y)*\[Mu])/
((1 + givenAreaRatio)*((-p2x)*p4y +
p1x*(-p2y + p4y) + (p1x - p2x)*(p3y - p4y)*\[Mu] +
p1y*(p2x + p4x*(-1 + \[Mu]) - p3x*\[Mu]) +
p2y*(p4x + p3x*\[Mu] - p4x*\[Mu])))
or mu as a function of labda:
with p1, p2, p3, p4 the coordinates of the area embracing the cut and aL the area of the ‘green’ polygon and aR the area of the ‘red’ polygon (see figure at the bottom of this post).
Not every point on one edge always gives a solution on the other edge and vice versa. I check the equation for lambda to find values of mu which set lambda at 0 or 1, and vice versa.
As a last step I minimize the maximum value of the aspect ratio functions of the two areas. In Mathematica language:
NMinimize[{Max[aspectRatio[area1tot], aspectRatio[area2tot]], \[Mu]range[[1]] <= \[Mu] <= \[Mu]range[[2]]}, \[Mu]]with are1tot and area2tot being the total areas for both halves parametrized by mu and lambda and where lambda is replaced by the above equestion for lambda in terms of mu. Now we have only one parameter left
I have a Mathematica notebook that I will send on request. Just send me an e-mail.