I have a polygon, says, Polygon[{0,0},{10,0},{10,10}{0,10}]
. I would like to cut it by a line (through two points) and take one half of it. Could you please suggest me the functions I should use? (I am very new to Mathematica).
Answer
I guess a pretty easy approach is to use HalfPlane
with your two points that define your line. RegionDifference
should do the rest.
RegionDifference[
Polygon[{{0, 0}, {10, 0}, {10, 10}, {0, 10}}],
HalfPlane[{{1, 0}, {3, 7}}, {1, 1}]];
RegionPlot[%]
Comments
Post a Comment