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 17, 2011

About spheres in Mathematica

Plotting a sphere in Mathematica is simple.

Graphics3D[Sphere[]]


What really happens ? Another method to plot a sphere is the following. But let's do a circle in 3D first.

ParametricPlot3D[{Cos[t], Sin[t], 0}, {t, 0, 2 \[Pi]}]


We can then simply rotate this circle as follows:

ParametricPlot3D[{Cos[t] Cos[u], Cos[u] Sin[t], Sin[u]}, {t, 0, 2 \[Pi]}, {u, 0, 2 \[Pi] }]


ParemetricPlot3D generates data we can use in Graphics3D:

sphere = First[ ParametricPlot3D[{Cos[t] Cos[u], Cos[u] Sin[t], Sin[u]}, {t, 0, 2 \[Pi]}, {u, 0, 2 \[Pi] }]]

A very large output was generated. Here is a sample of it:
GraphicsComplex[{{1.,4.48799*10^-7,4.48799*10^-7},{0.900969,0.433884,4.48799*10^-7},{0.62349,0.781832,4.48799*10^-7},<<2873>>,{-0.270598,-0.270598,-0.92388},{0.353553,-0.146447,-0.92388}},{{<<1>>},{{},<<3>>,{<<1>>}}},VertexNormals->{<<1>>}]
Show Less\[ThinSpace]Show More\[ThinSpace]Show Full Output\[ThinSpace]Set Size Limit...


Graphics3D[sphere]


Note the difference between Sphere[] a Mathematica function, and the variable sphere which we assigned the first element in the list generated by the ParametricPlot3D function.

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.)