0
$\begingroup$

I'm plotting a disk with ParametricPlot3d, but I need it to be drawn at z = 0.4, in order to join it with another plot.

ParametricPlot3D[
  {r*Sin[Pi/2]*Cos[ϕ], r*Sin[Pi/2]*Sin[ϕ], r*Cos[Pi/2]},
  {r, 0, 1}, {ϕ, 0, 2*Pi},
  Mesh -> None]

enter image description here

This is the result joining it with the other graph:

enter image description here

I tried with PlotRange -> {{-1, 1}, {-1, 1}, {0.4, 1}} but that just set the way it is graphed, doesn´t solve the problem:

enter image description here

I just need the disk to be graphed at z = 0.4 instead of z = 0.

Please help.

$\endgroup$
  • 2
    $\begingroup$ ParametricPlot3D[{r*Sin[Pi/2]*Cos[\[Phi]], r*Sin[Pi/2]*Sin[\[Phi]], 0.4}, {r, 0, 1}, {\[Phi], 0, 2*Pi}, Mesh -> None] $\endgroup$ – Bob Hanlon Oct 12 at 19:06
  • 1
    $\begingroup$ @BobHanlon You should post that as an answer, I presume it will be accepted since your answer has already been incorporated here. $\endgroup$ – C. E. Oct 12 at 21:28
4
$\begingroup$

If you specify the BoxRatios you can see a cone rather than a disk. The cone is essentially at 0. It looks like a cone due to machine precision in calculating r*Cos[Pi/2] which is exactly 0.

r*Cos[Pi/2]

(* 0 *)

ParametricPlot3D[{r*Sin[Pi/2]*Cos[ϕ], r*Sin[Pi/2]*Sin[ϕ], 
  r*Cos[Pi/2]}, {r, 0, 1}, {ϕ, 0, 2*Pi}, Mesh -> None, 
 BoxRatios -> {1, 1, 1}]

enter image description here

Your disc is exactly at 0 if you Evaluate the argument.

ParametricPlot3D[
 Evaluate@{r*Sin[Pi/2]*Cos[ϕ], r*Sin[Pi/2]*Sin[ϕ], 
   r*Cos[Pi/2]}, {r, 0, 1}, {ϕ, 0, 2*Pi}, Mesh -> None, 
 BoxRatios -> {1, 1, 1}]

enter image description here

To draw a disc at z == 0.4 specify the z function as a constant.

ParametricPlot3D[{r*Sin[Pi/2]*Cos[ϕ], r*Sin[Pi/2]*Sin[ϕ], 0.4}, {r, 
  0, 1}, {ϕ, 0, 2*Pi}, Mesh -> None]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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