0
$\begingroup$

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:

enter image description here

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]

$\endgroup$
6
  • 1
    $\begingroup$ You did not provide Delta. Anyway, you could interpolate data and do something like NSolve[interpolation[x,y]==0.01,{x,y}] $\endgroup$
    – mattiav27
    Commented Jul 2, 2022 at 6:11
  • $\begingroup$ @mattiav27 Sorry for that. I have updated the question by adding the value of Delta $\endgroup$
    – user36426
    Commented Jul 2, 2022 at 6:32
  • 1
    $\begingroup$ But your picture is Z=0.01 instead of Z = 0.001. $\endgroup$
    – cvgmt
    Commented Jul 2, 2022 at 7:46
  • $\begingroup$ @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. $\endgroup$
    – user36426
    Commented Jul 2, 2022 at 12:24
  • $\begingroup$ 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. $\endgroup$
    – mattiav27
    Commented Jul 2, 2022 at 12:40

2 Answers 2

2
$\begingroup$
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]

enter image description here

  • 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}

enter image description here

$\endgroup$
4
  • $\begingroup$ Yes, this is what I need. Now, how can I extract and display the intercepting points? $\endgroup$
    – user36426
    Commented Jul 2, 2022 at 12:21
  • $\begingroup$ @Majis See the updated. The pts are all the points in line. $\endgroup$
    – cvgmt
    Commented Jul 2, 2022 at 12:51
  • $\begingroup$ 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. $\endgroup$
    – user36426
    Commented Jul 2, 2022 at 12:55
  • $\begingroup$ @Majis The beginning point and the ending point. pts[[1]] and pts[[-1]] $\endgroup$
    – cvgmt
    Commented Jul 2, 2022 at 13:07
2
$\begingroup$

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}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Yes, this is what I need. Now, how can I extract and display the intercepting points? $\endgroup$
    – user36426
    Commented Jul 2, 2022 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.