# Cross Sections or slices of 3d figures - Mathematica

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


cut by a plane z=0 .

Thank you very much for your help.

• you want the cross section in a separate 2d plot, or overlayed on the 3d graphics?
– glS
Commented Aug 15, 2017 at 9:59
• In a separate 2d plot would be perfect Commented Aug 15, 2017 at 10:06

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:

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!

• I was thinking it could be done mathematically using heavyside functions. But this solves my problem. Thank you very much !!! Commented Aug 15, 2017 at 10:19
• @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. Commented Aug 15, 2017 at 10:22
• Your version is exactly what I need. Again Thank you very much for your time. Commented Aug 15, 2017 at 10:30