Skip to main content
21-Topaz II
July 14, 2017
Solved

How to plot countless spheres?

  • July 14, 2017
  • 3 replies
  • 5102 views

Hi everyone,
I am trying to represent on a 3D plot, spheres placed neatly one with respect to the other, as seen in the following picture.

Spheres.jpg
The problem arises when the argument of the plot consists of countless elementary functions.

 Is there a synthetic way to represent multiple functions so you do not have to write an endless list in the plot argument as shown below?

Spheres 1.jpg

 

Thank you very much

Franc

Best answer by Werner_E

I would guess that this will be easier to achieve in Prime as Primes 3D plot accepts NaNs (to separate the data of the various speheres) which Mathcad unfortunately does not. But as we know Prime is rather useless when it comes to plotting, especially 3D plots as its capabilities are beneath contempt.

I gave it a try in Mathcad and was surprised that it worked:

Pic1.png

 

Now you would only use just one plot argument for each color:

Pic2.png

3 replies

19-Tanzanite
July 14, 2017

Something like the attached?  ("countless" would be an exaggeration though!):

 

spheres.PNG

Alan

 

-MFra-21-Topaz IIAuthor
21-Topaz II
July 14, 2017

Hi Alan,

Without editing the program, but simply by modifying some 3D graphic properties (eg perspective and enabling fog) the graph becomes unacceptable as you can see below:

AS1.jpg

25-Diamond I
July 14, 2017

You won't be happy with my "solution", too.

After saving and reopening the worksheet I see this

Pic1.png

and this

Pic2.png

I had not changed anything in the sheet - not sure whats going on. By this I mean I don't understand why it worked in the first place. I would have expected what I see now as all the combined spheres are represented but just one contiguous data mesh - they have to be konnected. But I wrote already in my answer before that I was surprised that it worked - obvioiusly for good reason.

Adding a row of NaN*s between the data of the single speheres did not help as the 3Dplot component would refuse plotting with the usual "non-scalar value" error.

😞

Werner_E25-Diamond IAnswer
25-Diamond I
July 14, 2017

I would guess that this will be easier to achieve in Prime as Primes 3D plot accepts NaNs (to separate the data of the various speheres) which Mathcad unfortunately does not. But as we know Prime is rather useless when it comes to plotting, especially 3D plots as its capabilities are beneath contempt.

I gave it a try in Mathcad and was surprised that it worked:

Pic1.png

 

Now you would only use just one plot argument for each color:

Pic2.png

25-Diamond I
July 14, 2017

For whatever it may be woth here is a version for Prime.

I am throwing in a row of NaN's between the various spheres and in Prime that works. Some small modifactions were necessary as the data format created by "CreateMesh" is less nested in Prime than in Mathcad.

Unfortunately the overall plot qualitiy is .....

 

Pic3.png

File in P30 format attached