In Mathematica 9, I was able to use the function Graphics`Mesh`InPolygonQ
to determine whether a given point was within a polygon. How do I do this in Mathematica 10?
What I actually want to do is RegionPlot
only the regions where my data has support. I used to define
data2 = Flatten[Table[{i, j, Sqrt[i^2 + j^2]}, {i, 1, 20}, {j, i/2, i, i/6}], 1];
supports = data2[[All, 1 ;; 2]];
<< ComputationalGeometry`
pol = supports[[ConvexHull[supports]]];
inPol = Graphics`Mesh`InPolygonQ[pol, #] &;
and could then use
RegionPlot[(Sqrt[x^2 + y^2] < 10) && inPol[{x, y}], {x, 0, 20}, {y, 0, 10}]
in order to plot a function (in the actual application it will be an interpolating function) only on the interesting region.
In Mathematica 10, Graphics`Mesh`InPolygonQ
doesn't seem to exist anymore, or works differently.
Graphics`PolygonUtils`InPolygonQ[]
. The context change was already noted in this previous answer. $\endgroup$ – J. M.'s ennui♦ Nov 12 '15 at 3:04