# Strange effect in the SphericalPlot3D [closed]

I found something odd in Mathematica when using the SphericalPlot3D command.

Ranges for $$x,y∈[0,2 \pi]$$ are the same. All I do is swap sine and cosine.

But when I additionally change the intervals in places, everything "normalizes".

If this is an internal error in Mathematica, I ask developers and users to pay attention. In theory, this should give exactly the same result, however...

SphericalPlot3D[Sin[x] Cos[y], {x, 0, 2 Pi}, {y, 0, 2 Pi},
BoxRatios -> {1, 1, 1}, ImageSize -> Tiny];

SphericalPlot3D[Cos[x] Sin[y], {x, 0, 2 Pi}, {y, 0, 2 Pi},
BoxRatios -> {1, 1, 1}, ImageSize -> Tiny];


I have version 12 of Mathematica and Windows 10.

• Is there a special reason for using x,y instead of $\theta$, $\phi$ in the context of SphericalPlot3D?
– Syed
Commented Feb 4, 2022 at 6:14
• @Syed There is no particular reason, it's just for your own convenience. Any letters can be used.
– dtn
Commented Feb 4, 2022 at 6:15
• While specifying the function to be plotted, a change in the positions of x, y changes their meanings?
– Syed
Commented Feb 4, 2022 at 6:42
• There are a lot of confusion here. Once corrected, everything is fine. Voting to close. First of all, the range of the first argument is not $[0,2\pi]$, but $[0,\pi]$. Second, one should consider that the negative part of the function is not plotted. Third, Sin[x] Cos[y] and Cos[x] Sin[y] are not equivalent because the two angles have very different meaning. Commented Feb 4, 2022 at 6:51
• Yes, it would be possible, but what is the end goal you are trying to achieve? Maybe you should explain a bit more your real problem. Commented Feb 4, 2022 at 7:36

We can compare the two cases in Cartesian coordinate.

r1[θ_, φ_] = Sin[θ] Cos[φ];
r2[θ_, φ_] = Sin[φ] Cos[θ];

result1=FromSphericalCoordinates[{r, θ, φ}] /.r -> r1[θ, φ]
result2=FromSphericalCoordinates[{r, θ, φ}] /.r -> r2[θ, φ]


$$\left\{\sin ^2(\theta ) \cos ^2(\varphi ),\sin ^2(\theta ) \sin (\varphi ) \cos (\varphi ),\sin (\theta ) \cos (\theta ) \cos (\varphi )\right\}$$

$$\left\{\sin (\theta ) \cos (\theta ) \sin (\varphi ) \cos (\varphi ),\sin (\theta ) \cos (\theta ) \sin ^2(\varphi ),\cos ^2(\theta ) \sin (\varphi )\right\}$$

It means that r1[θ_, φ_] = Sin[θ] Cos[φ] and r2[θ_, φ_] = Sin[φ] Cos[θ] is different.