Message Boards Message Boards

0
|
3030 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

How SphericalPlot3D actually works?

I must do a graphical representation of a surface which is expressed in spherical coordinates. For this, I saw that Mathematica has a straightforward method with the SphericalPlot3D function. Having $x_1$, $x_2$ and $x_3$ in my code as the components of the vector: $$I^2=x_1^2+x_2^2+x_3^2$$

I just wrote the function and then applied the SphericalPlot3D method.

(*Constant values*)
A1 = 1;
A2 = 3;
A3 = 6;
SPIN = 15;
(*components of my vector*)
x1[spin_, theta_] := spin*Cos[theta];
x2[spin_, theta_, fi_] := spin*Sin[theta] Cos[fi];
x3[spin_, theta_, fi_] := spin*Sin[theta] Sin[fi];

(*angular momentum I squared*)
Spin2[spin_, theta_, fi_] := 
  x1[spin, theta]^2 + x2[spin, theta, fi]^2 + x3[spin, theta, fi]^2;

s1 = SphericalPlot3D[
  Sqrt[Spin2[SPIN, x, y]], {x, 0, \[Pi]}, {y, 0, 2 \[Pi]}, 
  LabelStyle -> {14, Bold, Black, FontFamily -> "Times New Roman"}]
Show[s1]

However, the plot which I obtain has values on the 3 axes which are confusing for me: I expect that on two of the three axes (e.g. the one that corresponds to polar angle $\theta$ and azimuthal angle $\varphi$) to have values no more than 3.14 and 6.28, but al three axes have values which are larger than those.

Is my understanding of a spherical plot in Mathematica wrong?

Thank you in advance!

POSTED BY: Robert Poenaru

You are plotting the value of a constant function on the sphere:

In[23]:= Sqrt[Spin2[SPIN, x, y]] // Simplify

Out[23]= 15

This way you get a sphere with radius 15. Your coordinates x,y are not cartesian: they fix a direction in space.

Compare what you get with PolarPlot[15,{theta,0,2Pi}]: this associates with every direction theta a radius with length 15, so that you get a circle with radius 15.

POSTED BY: Gianluca Gorni
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