cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How to plot countless spheres?

-MFra-
21-Topaz II

How to plot countless spheres?

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

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:-MFra-)

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

View solution in original post

10 REPLIES 10

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

 

spheres.PNG

Alan

 

-MFra-
21-Topaz II
(To:AlanStevens)

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

Werner_E
24-Ruby V
(To:-MFra-)

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.

😞

-MFra-
21-Topaz II
(To:Werner_E)

it's all OK! I wrote cos (φ) instead of cos (θ).

Werner_E
24-Ruby V
(To:-MFra-)

 


@F.M. wrote:

it's all OK!


Really!? I am surprised. Have you already tried saving the sheet, closing Mathcad and then relaoding it?

 


I wrote cos (φ) instead of cos (θ).

If thats all you changed then you get no sphere!

It should be

Pic1.png

-MFra-
21-Topaz II
(To:Werner_E)

It is all OK! Look :

Spheres 2.jpg

Werner_E
24-Ruby V
(To:-MFra-)

Yes, thats what I understood from your first post. But if you do just this change, we don'tr get spheres anymore

Pic1.png

I see that handling of the pics is even more cumbersome. Not only that we cannot copy and paste from the clipboard, there is no way to look at a picture in its full size/resolution. When we click on the pic a window opens to show it scaled down and there is no way to see it in its original state other than downloading it. What a crap!

 

P.S.: I see you are using the first version of my screenshot where some limits in Createmesh were wrong.

 


@F.M. wrote:

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


 

Yes. You have to choose the properties carefully to get the desired look. All the spheres are really just part of a large single matrix and hence are actually interconnected. M15 doesn't allow for NaNs to be used in 3D plots to allow for disconnects between the spheres.

 

Alan

Werner_E
24-Ruby V
(To:-MFra-)

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

Werner_E
24-Ruby V
(To:-MFra-)

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

Top Tags