0
$\begingroup$

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$?

$\endgroup$
4
  • 1
    $\begingroup$ 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. $\endgroup$
    – flinty
    Commented May 23, 2021 at 20:40
  • 1
    $\begingroup$ 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] $\endgroup$
    – flinty
    Commented May 23, 2021 at 20:44
  • $\begingroup$ @flinty {θ, 0, π/2} $\endgroup$
    – cvgmt
    Commented May 23, 2021 at 23:43
  • $\begingroup$ @cvgmt that's only a quarter circle, but I suppose that's what OP wanted given {x, 0, 1}, {y, 0, 1} $\endgroup$
    – flinty
    Commented May 24, 2021 at 0:30

2 Answers 2

1
$\begingroup$

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]

enter image description here

$\endgroup$
0
$\begingroup$

workaround RegionFunction ( see @flinty's comment )

Plot3D[{1/(2 Sqrt[2] x y)}, {x, 0, 1}, {y, 0, 1}, 
RegionFunction -> Function[{x, y },
    Evaluate[ grad = Grad[ x^2 + y^2 - 1, {x, y }]; -.02 Sqrt[grad . grad ] <= x^2 + y^2 - 1 <= .02 Sqrt[grad . grad ] ]]
, Mesh -> False , ClippingStyle -> None , BoundaryStyle -> None ]

enter image description here

$\endgroup$

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