Why plotting the torus with this parametrization gives something that doesn't look like the torus?

54 Views Asked by At

I am trying to plot the following torus with $0\leq x \leq 1$ and $0\leq y \leq 1$.

$$((2+\cos(2 \pi x)) \cos(2\pi y),\;(2+\cos(2 \pi x)) \sin (2\pi y),\;\sin(2\pi y))$$

I am using Mathematica and collecting some points from some finite values of $x,y$ and plotting each point, this is what I get:

enter image description here

I am a bit confused: This doesn't really seems like a torus. Why is this happening? I am using the exact parametrization I found in Wikipedia.

1

There are 1 best solutions below

0
On

I shall give MATLAB commands for generating a 'Torus'..

%%Create R and THETA data

theta = linspace(0,2*pi,50) ;

r = linspace(2pi,3pi,50);

[R,T] = meshgrid(r,theta);

%%Create top and bottom halves

Z_top = 2*sin(R);

Z_bottom = -2*sin(R);

%%Convert to Cartesian coordinates and plot

[X,Y,Z] = pol2cart(T,R,Z_top);

surf(X,Y,Z);

hold on;

[X,Y,Z] = pol2cart(T,R,Z_bottom);

surf(X,Y,Z);

axis equal

shading interp

Torus