1
$\begingroup$

I want to plot a torus using the equation of its surface

 With[{R = 106, r = 50}, ContourPlot3D[(Sqrt[x^2 + y^2] - R)^2 + z^2 == r^2, {x, -(R + r), R + r}, {y, -(R + r), R + r}, {z, -r, r}]]

But, but the torus shown is flattened. When I use {z, -(r + R), r + R} it works. Why does it not work with the interval from -r to r?

$\endgroup$
2
$\begingroup$

You need to change the box ratios:

BoxRatios->{1,1,1/3}

enter image description here

$\endgroup$
  • $\begingroup$ BoxRatios -> Automatic works too. (+1) $\endgroup$ – kglr May 23 at 1:28
  • $\begingroup$ Thank you , why this instruction is necessary, i am new at this? $\endgroup$ – Max May 23 at 1:46
  • $\begingroup$ Your plotting ranges are from -156 to 156 in $x$ and $y$, but only -50 to 50 in $z$. Mathematica makes a default box of ratios 1,1,1 in scale (stretching each axis to fit). If you want a plot that is thin and flat (for instance), you'll have to change to BoxRatios. Clear? $\endgroup$ – David G. Stork May 23 at 2:02

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.