# Test whether point belongs to the region between contour lines in ListContourPlot

A simple question but, unfortunately, I could not find the answer. Suppose I have a ListContourPlot built from some data set, e.g.,

plot = ListContourPlot[RandomReal[1, {50, 3}], ContourLabels -> All];
Show[plot, Graphics[{Red, PointSize[Large], Point[{0.5, 0.5}]}]]


I need to be able to determine whether a particular point lies within a given range on this contour plot. For example, I want to check if the red point with coordinates {0.5,0.5} on my contour plot would fall between the contour lines 0.4 and 0.6. Notice that this point is not necessarily a part of the original data set used to make the plot. Just a True/False result of such a test would do.

## 1 Answer

pts = RandomReal[1, {50, 3}];
plot = ListContourPlot[pts, ContourLabels -> All];
Show[plot, Graphics[{Red, PointSize[Large], Point[{0.5, 0.5}]}]]


ip = Interpolation[pts, InterpolationOrder -> All];

0.4 < ip[0.5, 0.5] < 0.6


False

• thanks! that's much simpler than I thought. – Alexey Galda Nov 5 '14 at 1:21