1
$\begingroup$

I am trying to get a cross-section of a 3d figure to show behavior of the functions at certain the values. However I only found SliceContourPlot3D which works for contour plots but not regular 3d plots. Is it way to generate cross sections ? For example the cross section of the graph

a0 = 10; r = 2; L0 = 0.5;
Plot3D[{Tan[
    x L0 Sqrt[-1 + y^2 a0^2]] - (Sqrt[1 - y^2]/Sqrt[y^2 a0^2 - 1]
       r )}, {x, 0.1, 10}, {y, 1/a0, 1}, PlotPoints -> 20, 
 PlotRange -> {Automatic, Automatic, {-1, 2}}]

enter image description here

cut by a plane z=0 .

Thank you very much for your help.

$\endgroup$
  • $\begingroup$ you want the cross section in a separate 2d plot, or overlayed on the 3d graphics? $\endgroup$ – glS Aug 15 '17 at 9:59
  • $\begingroup$ In a separate 2d plot would be perfect $\endgroup$ – John David Aug 15 '17 at 10:06
2
$\begingroup$

Try this:

Manipulate[
 Row[{
   Show[{
     Plot3D[{Tan[
         x L0 Sqrt[-1 + y^2 a0^2]] - (Sqrt[1 - y^2]/
           Sqrt[y^2 a0^2 - 1] r)}, {x, 0.1, 10}, {y, 1/a0, 1}, 
      PlotPoints -> ControlActive[5, 20], PlotRange -> {-1, 10}, 
      AxesLabel -> {"x", "y", "z"}],
     Graphics3D[{Blue, Opacity[0.5], 
       HalfPlane[{{0, 0, z}, {10, 0, z}}, {0, 1, 0}]}]
     }, ImageSize -> 300],
   ContourPlot[
    Tan[x L0 Sqrt[-1 + y^2 a0^2]] - (Sqrt[1 - y^2]/
         Sqrt[y^2 a0^2 - 1] r) == z, {x, 0.1, 10}, {y, 0.11, 1}, 
    PlotPoints -> ControlActive[5, 20], ImageSize -> 300]
   }],
 {z, 0, 10} ]

yielding the following:

enter image description here

The left panel shows the position of the cutting plane, and the right one - the cross-section of the 3D plot. Take care to wait a bit after you have moved the slider.

Have fun!

$\endgroup$
  • $\begingroup$ I was thinking it could be done mathematically using heavyside functions. But this solves my problem. Thank you very much !!! $\endgroup$ – John David Aug 15 '17 at 10:19
  • $\begingroup$ @John David For Mma it is typical that a problem can be solved with multiple approaches, and one chooses the approach that is closer to him. May be that the Heaviside functions will also give a solution. $\endgroup$ – Alexei Boulbitch Aug 15 '17 at 10:22
  • $\begingroup$ Your version is exactly what I need. Again Thank you very much for your time. $\endgroup$ – John David Aug 15 '17 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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