If you have Mathematica and input:
ParametricPlot3D[{Sin[u], Sin[v], Sin[u + v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi]
You will generate a 3D solid that looks like a cube with crushed in sides. What I want to do is take cross sections of this solid with the horizontal planes: z = 0
, z = 1
, z= -1
, z= 1/2
, and z= -1/2
.
What is the command to generate plots of these cross sections?
This can be done by specifying a RegionFunction
, which is a boolean condition that determines where the surface is allowed to be plotted. Here, you would use
RegionFunction -> Function[{x, y, z}, z < a]
where a
is the height at which you want the intersecting plane to be. To illustrate this, I'll make a movie:
t = Table[
ParametricPlot3D[{Sin[u], Sin[v], Sin[u + v]}, {u, 0, 2 Pi}, {v, 0,
2 Pi}, RegionFunction -> Function[{x, y, z}, z < a],
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}],
{a, 1, -1, -.1}
]
And now I'll export it as a GIF
animation to include below:
Export["section.gif", Join[t, Rest[Reverse[t]]]]
To just get the intersection curves you could use the MeshFunctions
and Mesh
options, e.g.
ParametricPlot3D[{Sin[u], Sin[v], Sin[u + v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
MeshFunctions -> {#3 &}, Mesh -> {Range[-1, 1, 1/2]},
PlotStyle -> None, PlotPoints -> 50]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With