# How can I extract the intercepts between two planes and visualize them?

Below is the data for my first plane:

data = Flatten[Z = 0.01; Table[{X, Y, 4*Z*Y/X}, {X, 2, 20, 0.1}, {Y, 2, 10, 0.1}], 1];


The second plane is  z = 0.01

ref = Table[Z = 0.01, {x, 2, 20, 0.1}, {y, 2, 10, 0.1}];


Now I have plotted both the planes.

ListPlot3D[{data, ref}, PlotRange -> {{2, 20}, {2, 10}, {0, 0.2}}, AxesLabel -> {"X", "Y", "Z"}]


And here is the result:

As we can see that roughly the X-intercept range is {8, 20} while the Y-intercept range is {2, 5}

How can I extract these ranges and visualise them in the plot?

[Edit 1: Delta = z = 0.01] [Edit 2: Updated the expression for data]

• You did not provide Delta. Anyway, you could interpolate data and do something like NSolve[interpolation[x,y]==0.01,{x,y}] Commented Jul 2, 2022 at 6:11
• @mattiav27 Sorry for that. I have updated the question by adding the value of Delta Commented Jul 2, 2022 at 6:32
• But your picture is Z=0.01 instead of Z = 0.001. Commented Jul 2, 2022 at 7:46
• @cvgmt Actually, I drew two lines (Z=0.01 and Z=0.001). Therefore, by mistake, I pasted the wrong line. I have updated it. Thanks for pointing it out. Commented Jul 2, 2022 at 12:24
• I am not sure I understand your question. It seems you simply need to solve 0.01=4*0.01*Y/X as a function of X or Y. If this is the case Solve[1/100==4*1/100*Y/X,X] will give the answer. Commented Jul 2, 2022 at 12:40

ListPlot3D[data, PlotRange -> {{2, 20}, {2, 10}, {0, 0.2}},
AxesLabel -> {"X", "Y", "Z"}, MeshFunctions -> {#3 &},
Mesh -> {{0.01}}, MeshShading -> {Directive[Orange, Opacity[.1]], None},
BoundaryStyle -> None, Boxed -> False]


• The intersection points.
data = Flatten[Z = 0.01;
Table[{X, Y, 4*Z*Y/X}, {X, 2, 20, 0.1}, {Y, 2, 10, 0.1}], 1];
plot = ListPlot3D[data, PlotRange -> {{2, 20}, {2, 10}, {0, 0.2}},
AxesLabel -> {"X", "Y", "Z"}, MeshFunctions -> {#3 &},
Mesh -> {{0.01}}, PlotStyle -> None, BoundaryStyle -> None,
Boxed -> False, Axes -> False];
(*pts=DiscretizeGraphics[plot]//MeshCoordinates*)
pts = Cases[Normal[plot], {x_Real, y_Real, z_Real} :> {x, y, z},
Infinity];
Graphics3D[{Point[pts], AbsolutePointSize[10], Red,
Point[{pts[[1]], pts[[-1]]}]}, Boxed -> False]
pts[[1]]
pts[[-1]]


{8., 2., 0.01} {20., 5., 0.01}

• Yes, this is what I need. Now, how can I extract and display the intercepting points? Commented Jul 2, 2022 at 12:21
• @Majis See the updated. The pts are all the points in line. Commented Jul 2, 2022 at 12:51
• As mentioned in my question, I want the end coordinates like {8,20,0.01} and {2,5,0.01}. I got it by just solving the equations. Commented Jul 2, 2022 at 12:55
• @Majis The beginning point and the ending point. pts[[1]] and pts[[-1]] Commented Jul 2, 2022 at 13:07

You may use "Mesh" to draw a line with constant z==0.001:

data = Flatten[Z = 0.001;
Table[{X, Y, 4*Z*Y/X}, {X, 2, 20, 0.1}, {Y, 2, 10, 0.1}], 1];
ListPlot3D[data, MeshFunctions -> (#3 &), Mesh -> {{0.001}},
MeshStyle -> {Red, Thick}]


• Yes, this is what I need. Now, how can I extract and display the intercepting points? Commented Jul 2, 2022 at 12:26