Skip to main content
1-Visitor
January 22, 2016
Solved

How to draw a full sphere

  • January 22, 2016
  • 1 reply
  • 7490 views

Hi,

I have drawn a sphere (you can find the attached file), but the data points are on the surface. I want a full sphere. As an example I drew only @r=3 and @r=5

My first question is, I don't have an idea why we write λ(Θ,ϕ) <-- F(r,0,0,0,Θ,ϕ) on the 3D scatter plot. Why cannot we write F(r,0,0,0,Θ,ϕ) on the graph?


I tried to write a for loop for the radius (r=0, r=0.1 .... r=n) and i want to see all the spheres on the graph.

One more important point is that I need the x,y,z coordinates for these spheres but even for one single sphere I cannot see the coordinates of the data points.

So to sum up,

I have the code that draws a sphere but it only draws the data points on the surface, I need a full sphere. And, I need the coordinates of these data points. Could you please help me?

Best answer by RichardJ

If you really wish to do this, here you go. It's going to take a while to calculate 200 spheres though.

1 reply

23-Emerald IV
January 22, 2016

Side note.

You have an error in the definitions of y() and z(), their definitions on the rhs use y0 and z0 respectively, but their parameter lists use x0...

Luc

hyener1-VisitorAuthor
1-Visitor
January 22, 2016

Oh, yes I corrected it thank you.

Do you know how to solve my problem?

23-Emerald IV
January 22, 2016

Like this?

Success!
Luc

Oh, and the matrix X holds all the x-values of the datapoints (for each of the indexes i and j), matrix Y holds the corresponding y-values and Z...