5

I want to plot the real part of the SphericalHarmonicY[1,1,θ,φ]. That is, I want to plot

$$ - \frac{1}{2}\sqrt {\frac{3}{{2\pi }}} \cos[\phi ]\sin[\theta ]$$

To do so, I evaluated the following expression:

SphericalPlot3D[-(1/2) Sqrt[3/(2 π)] Cos[φ] Sin[θ], {θ, 0, π}, {φ, 0, 2 π}]

But the result I got doesn't show the negtive part. What is wrong?

spherical

chris
  • 22,860
  • 5
  • 60
  • 149
matheorem
  • 17,132
  • 8
  • 45
  • 115
  • What a negative part do you expect ? – Artes Jan 01 '13 at 13:41
  • Possible duplicate: http://mathematica.stackexchange.com/questions/16534/problem-with-coloring-spherical-harmonics – Mr.Wizard Jan 01 '13 at 14:22
  • @Mr.Wizard, I don't think it's a duplicate. That question is about colouring the plot; this one is about parts of the desired plot not showing up at all. Unless there's some subtle property of Mathematica I'm missing that makes these the same thing, which, given that Mathematica is sufficiently complicated, is a possibility I won't dismiss... –  Jan 01 '13 at 14:36
  • @Rahul Someone flagged this post to be closed but didn't post that link. I chose not to close the question myself, but I put the link there for others to decide. – Mr.Wizard Jan 01 '13 at 14:38

1 Answers1

12

The negative part is plotted with negative radius, so it's at the opposite position of where you expect it -- it's exactly overlapping the positive part. You'll have to plot its absolute value or its square, as Nasser suggests, and indicate its negativeness using a different colour or something. Here's one way to do it:

f[θ_, φ_] := -(1/2) Sqrt[3/(2 π)] Cos[φ] Sin[θ]
pos[x_] := If[x >= 0, x, Null]
SphericalPlot3D[{pos[f[θ, φ]], pos[-f[θ, φ]]},
 {θ, 0, π}, {φ, 0, 2 π}, 
 PlotStyle -> {Lighter@Lighter@Red, Lighter@Lighter@Blue}, 
 Lighting -> "Neutral"]

enter image description here