I want to be able to find the area of the intersection between a hexagon and a slice. I have tried RegionMeasure
or Area
but I seem to get incorrect answers. RegionMeasure
gives length when the intersection is a line, so I switched to Area
but sometimes it still gives weird answers, when the intersection happens to be a line.
One reason why I think this might occur is that I build the hexagon using Polygon
, but the "slice" is with Disk
. Is that the problem? How to I make a region as a slice, so that Area[RegionIntersection[hexagon, slice]]
between the two regions will always give $0$ for a line intersection and no intersection, i.e. return a nonzero result only for 2D intersection.
See picture. I want to know the area of intersection of the black hexagon will each of the 6 (colored for visualization) slices below. The answer should be non-zero for the 2 upper left slices, and 0 for every other slice, even though some have "line intersections".
Thanks.
EDIT: The problem is that edges get non-zero measure. Why is the below code giving .7, and not 0?
DiskR = 1.5;
Show[
Graphics[{Orange, Opacity[0.35],
Disk[{0, 0}, DiskR, {Pi/6, 3 Pi/6}]}],
Graphics[Polygon[{{0, 0}, {0, .7}, {-1, 1}}]]]
and
Area[
RegionIntersection[
Polygon[{{0, 0}, {0, .7}, {-1, 1}}],
Disk[{0, 0}, DiskR, {Pi/6, 3 Pi/6}]
]
]
Polygon[CirclePoints[{-(Sqrt[3]/2), 1/2}, {1, π/6}, 6]] ~RegionIntersection~ Disk[{0, 0}, 3, {π/2, π/2 + π/3}] // Area
$\endgroup$DiskR
, but replacingDiskR
with 3/2 seems to give something similar to your last figure. However, I can't reproduce your last result:Area[ RegionIntersection[ Polygon[{{0, 0}, {0, .7}, {-1, 1}}], Disk[{0, 0}, 3/2, {Pi/6, 3 Pi/6}] ] ]
returns $0$ as you expected, not $0.7$ as you reported (results). I am using MMA 10.4 on Win7-64. What version are you using? $\endgroup$