How to plot a surface from a system of equations?
Define an implicit region with your equations by And
-combining them:
ir = ImplicitRegion[x == y*z && y^2 == x*z, {x, y, z}];
Make a 3D plot by discretizing the implicit region:
DiscretizeRegion[ir, 3*{{-1, 1}, {-1, 1}, {-1, 1}},
MaxCellMeasure -> 10^-4, Boxed -> True, Axes -> True]
You can "plot" one equation as a contour and draw the mesh lines of the other equation onto it by using the option MeshFunctions
.
curve = ContourPlot3D[
y^2 == x z
{x, -10, 10}, {y, -10, 10}, {z, -10, 10},
MeshFunctions -> Function[{x, y, z}, x - y z],
Mesh -> {{0}},
ContourStyle -> None,
BoundaryStyle -> None,
MeshStyle -> Thick,
PlotPoints -> 100
]
Here is also a compined plot that looks a bit more fancy:
surf = ContourPlot3D[{y^2 == x z, x == y z}, {x, -10, 10}, {y, -10, 10}, {z, -10, 10}, ContourStyle -> Opacity[0.4]];
Show[
surf,
curve /. Line[x__] :> {Lighter@Black, Specularity[White, 30],
Tube[x, 0.2]},
Lighting -> "Neutral"
]