# Cutting a polygon into the pieces that lie on opposite sides a line passing through it

Would you please explain to me a way that I can divide a polygon by means of a special line "represents the zero axis" into two regions so that I can determine each region individually. The question of : How to check if a line segment intersects with a polygon? is a nice example, however, I couldn't find a correct way to separate both upper and lower sub-polygons individually, and hence I can find the Area for each of them. The data input are same for the mentioned question:

list = {{4.4, 14}, {6.7, 15.25}, {6.9, 12.8}, {9.5, 14.9}, {13.2,
11.9}, {10.3, 12.3}, {6.8, 9.5}, {13.3, 7.7}, {0.6, 1.1}, {1.3,
2.4}, {2.45, 4.7}};
Graphics[{Red, Line[{{0, 10}, {20, 0}}], Black, Polygon[list]}]

• I have not tested this, but have you tried HalfPlane and RegionIntersection (potentially followed by another discretization step)? – Szabolcs Apr 25 '17 at 7:49
• @Kuba The inputs and outputs are same for this example:mathematica.stackexchange.com/questions/66152/… – Mehmet Apr 25 '17 at 8:03
• @Szabolcs, I tried to use the mentioned commands but RegionIntersection probably needs same number of Points? – Mehmet Apr 25 '17 at 8:06
• I am not sure what you mean by "needs same number of Points", but what have you tried exactly? It works for me. Did you look up HalfPlane and RegionIntersection in the documentation? – Szabolcs Apr 25 '17 at 9:07

Following Szabolcs' suggestion,

Graphics[{Red, HalfPlane[{{0, 10}, {20, 0}}, {0, 1}], Black, Polygon[list]}] Then direct applying RegionIntersection gives what you need:

Graphics[{RegionIntersection[HalfPlane[{{0, 10}, {20, 0}}, {0, 1}], Polygon[list]]}] In:

xss = {{4.4, 14}, {6.7, 15.25}, {6.9, 12.8}, {9.5, 14.9}, {13.2,
11.9}, {10.3, 12.3}, {6.8, 9.5}, {13.3, 7.7}, {0.6, 1.1}, {1.3,
2.4}, {2.45, 4.7}};
halfPlane[y_] := HalfPlane[{{0, 10}, {20, 0}}, {0, y}];
halfRegion[reg1_, reg2_] :=
DiscretizeRegion[RegionIntersection[reg1, reg2], AspectRatio -> 1]
halfRegion[Polygon[xss], halfPlane[#]] & /@ {-1, 1}