Message Boards Message Boards

Empty output from an old 3DParametricPlot3D code

I am a new user of Mathematica. Currently, I am using version 13.2. I recently purchased a book titled "GRAPHICS with MATHEMATICA FRACTALS, JULIA SETS, PATTERNS and NATURAL FORMS". I did this because of the work that I have done previously on Fractals and Chaos Theory. One of the ParametricPlot3D examples that was provided is shown below:

ParametricPlot3D[
 Evaluate[
  Table[{Sin[2 (t + \[Pi])] Cos[(t + \[Pi])] Sin[n 36 °], 
    Sin[2 (t + \[Pi])] Cos[(t + \[Pi])]  Cos[n 36 °], 
    Sin[(t + \[Pi])] Sin[t + \[Pi]], {Thickness[
      0.1 Sin[\[Pi] t/(\[Pi] - 2)]], 
     RGBColor[(0.34 + t/(3 (\[Pi] - 2))), ( 
       0.55 + t/(3.5 (\[Pi] - 2))), (0.12 + t/(
        3.5 (\[Pi] - 2)))]}}, {n, 0, 10}], {t, 0, \[Pi] - 2}], 
 Axes -> False, Boxed -> False, PlotPoints -> 200, 
 BoxRatios -> {1, 1, 1}, ViewPoint -> {0.862, -2.214, 2.409}]

When I evaluated this expression, I received a blank output cell. In the book it showed a specific image. I am wondering what the problem is with the above syntax. The book was published in 2004 so I imagine that the version it uses is version 5 or 6 of Mathematica.

POSTED BY: Paul Swanson
Posted 1 year ago

The basic form you're creating in the Table looks like this:

{Sin[2 (t + \[Pi])] Cos[(t + \[Pi])] Sin[n 36 °], 
 Sin[2 (t + \[Pi])] Cos[(t + \[Pi])] Cos[n 36 °], 
 Sin[(t + \[Pi])] Sin[t + \[Pi]], {Thickness[
   0.1 Sin[\[Pi] t/(\[Pi] - 2)]], 
  RGBColor[(0.34 + t/(3 (\[Pi] - 2))), (0.55 + 
     t/(3.5 (\[Pi] - 2))), (0.12 + t/(3.5 (\[Pi] - 2)))]}}

Which, simplified is this:

{x, y, z, {< style directives >}}

ParametricPlot3D expects this to be just a three-valued list: {x, y, z}. Maybe putting the styling directives right into the list was okay back then, but I think this is causing your problem now. You'll need to move those styling directives into a PlotStyle option. To at least get a visible plot, just remove that fourth element from each list that Table creates. Also, I think it's a bit cleaner to move your closing bracket so that Evaluate just encloses the Table and not the plot variable. So, something like this:

ParametricPlot3D[
 Evaluate[
  Table[{Sin[2 (t + \[Pi])] Cos[(t + \[Pi])] Sin[n 36 °], 
    Sin[2 (t + \[Pi])] Cos[(t + \[Pi])] Cos[n 36 °], 
    Sin[(t + \[Pi])] Sin[t + \[Pi]]}, {n, 0, 10}]], {t, 0, \[Pi] - 2},
  Axes -> False, Boxed -> False, PlotPoints -> 200, 
 BoxRatios -> {1, 1, 1}, ViewPoint -> {0.862, -2.214, 2.409}]
POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract