As of May 4 2007 the scripts will autodetect your timezone settings. Nothing here has to be changed, but there are a few things

Please follow this blog

Search this blog

Sunday, July 24, 2011

About tori in Mathematica

There is no graphics primitive in Mathematica which enables us to plot a torus with one simple command. So we have to make it ourselves. If you read the post 'About spheres in Mathematica' you may have already tried it for yourself. In any case creating a torus in Mathematica is intuitively simple.

We use a red point, as a reference only and start ( again ) with a circle and view the graphical universe from a Left viewpoint.

point = {Red, AbsolutePointSize[10], Point[{0, 0, 0}]}
to1 = First[ ParametricPlot3D[{(1), (Cos[u]), Sin[u]}, {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]}]];
Graphics3D[{point, to1}, ViewPoint -> Left]

We move the circle 3 units in the y-direction.

to2 = First[ ParametricPlot3D[{(1), (3 + Cos[u]), Sin[u]}, {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]}]];
Graphics3D[{point, to2}, ViewPoint -> Left]

We can then simply rotate this circle as follows:

to3 = First[ParametricPlot3D[{(Cos[v]), Sin[v] (3 + Cos[u]), Sin[u]}, {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]}]];
Graphics3D[{point, to3}, ViewPoint -> Left]

But this is not entirely what we had in mind, but this can be easily corrected as follows.

to = First[ParametricPlot3D[{Cos[v] (3 + Cos[u]), Sin[v] (3 + Cos[u]), Sin[u]}, {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]}]];
Graphics3D[{point, to}, ViewPoint -> Top]

Finally, a torus, viewed from the top.

No comments:

Post a Comment

Popular Posts

Welcome to The Bridge

Mathematics: is it the fabric of MEST?
This is my voyage
My continuous mission
To uncover hidden structures
To create new theorems and proofs
To boldly go where no man has gone before

(Raumpatrouille – Die phantastischen Abenteuer des Raumschiffes Orion, colloquially aka Raumpatrouille Orion was the first German science fiction television series. Its seven episodes were broadcast by ARD beginning September 17, 1966. The series has since acquired cult status in Germany. Broadcast six years before Star Trek first aired in West Germany (in 1972), it became a huge success.)