# Plot with constraints [closed]

How can I plot Plot3D[{1/(2 Sqrt[2] x y)}, {x, 0, 1}, {y, 0, 1}] such that the only portion gets plotted for which $$x^2 + y^2 =1$$?

• Use a RegionFunction like this Plot3D[{1/(2 Sqrt[2] x y)}, {x, 0, 1}, {y, 0, 1}, RegionFunction -> Function[{x, y, z}, x^2 + y^2 <= 1]] . Bear in mind I've used $\leq1$ not $=1$ because $=1$ would produce a line too thin to show up on a Plot3D. If you want this, you're better off using a parametric plot. Commented May 23, 2021 at 20:40
• Restricted to the circle boundary it would look like this ParametricPlot3D[{x, y, 1/(2 Sqrt[2] x y)} /. {x -> Cos[θ], y -> Sin[θ]}, {θ, 0, 2 π}, BoxRatios -> 1] Commented May 23, 2021 at 20:44
• @flinty {θ, 0, π/2} Commented May 23, 2021 at 23:43
• @cvgmt that's only a quarter circle, but I suppose that's what OP wanted given {x, 0, 1}, {y, 0, 1} Commented May 24, 2021 at 0:30

Use MeshFunctions x^2+y^2 and set Mesh to {{1}}.

Plot3D[1/(2 Sqrt[2] x y), {x, 0, 1}, {y, 0, 1},
AxesLabel -> {x, y, z}, MeshFunctions -> Function[{x, y}, x^2 + y^2],
Mesh -> {{1}}, MeshStyle -> {Thick, Red}, PlotStyle -> None,
ClippingStyle -> None, BoundaryStyle -> None]


workaround RegionFunction ( see @flinty's comment )

Plot3D[{1/(2 Sqrt[2] x y)}, {x, 0, 1}, {y, 0, 1},
RegionFunction -> Function[{x, y },