Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spherical co-ordinate graphics in Mathematica

Is it possible to create graphics of spherical co-ordinate system like this in mathematica or should I use photoshop? I'm asking because I want a high resolution graphic, but lot of the files on internet are grainy when zoomed.

Here is the image:

enter image description here

like image 410
J. B. DeShaw Avatar asked Apr 25 '11 00:04

J. B. DeShaw


People also ask

What is spherical coordinate?

Spherical coordinates determine the position of a point in three-dimensional space based on the distance ρ from the origin and two angles θ and ϕ. If one is familiar with polar coordinates, then the angle θ isn't too difficult to understand as it is essentially the same as the angle θ from polar coordinates.


1 Answers

The figure is made up of simple geometric shapes and these can be easily recreated in Mathematica using equations. Here is one that is close to this plot, which IMO is less cluttered than the above, but you can always use these ideas to recreate your image exactly.

Clear[ellipsePhi, ellipseTheta, circle]
circle[x_] = {Cos[x], Sin[x]};
ellipsePhi[x_, a_: - Pi/2] = {Cos[x - a]/3, Sin[x + a]};
ellipseTheta[x_, a_: 0] = {Cos[x + a], Sin[-x - a]/2};
(*Main circle*)
ParametricPlot[circle[x], {x, 0, 2 Pi},
 PlotStyle -> Black,
 Epilog -> First /@ {
    (*Ellipses*)

    ParametricPlot[{ellipsePhi[x], ellipsePhi[-x], ellipseTheta[-x], 
      ellipseTheta[x]}, {x, 0, Pi},
     PlotStyle -> {{Black, Dashed}, Black}],
    (*Co-ordinate axes*)

    Graphics[
     Table[GeometricTransformation[{Arrowheads[0.03], 
        Arrow[{{0, 0}, {1.2, 0}}]}, 
       ReflectionMatrix[circle[x]]], {x, {Pi/2, -Pi/4, Pi/8}}]],
(*mark point, rho, phi & theta directions*)

ParametricPlot[{ellipsePhi[x, Pi/2], ellipseTheta[-x, 13 Pi/20]}, {x, 
   0, Pi/4},
  PlotStyle -> {{Red, Thick}, {Blue, Thick}}] /. 
 Line[x__] :> Sequence[Arrowheads[0.03], Arrow[x]],
Graphics[{{Directive[Darker@Green, Thick], Arrowheads[0.03], 
   Arrow[{{0, 0}, ellipsePhi[-3 Pi/4]}]},
  {Directive[Purple], Disk[ellipsePhi[-3 Pi/4], 0.02]}}],
(*text*)
Graphics[{
  Text[Style["x", Italic, Larger], 1.25 circle[5 Pi/4]],
  Text[Style["y", Italic, Larger], 1.25 circle[0]],
  Text[Style["z", Italic, Larger], 1.25 circle[Pi/2]],
  Text[Style["\[Rho]", Italic, Larger], 0.4 circle[4 Pi/11]],
  Text[Style["\[CurlyPhi]", Italic, Larger], 
   1.1 ellipsePhi[Pi + Pi/5]],
  Text[Style["\[Theta]", Italic, Larger], 
   1.1 ellipseTheta[13 Pi/20 - Pi/8]],
  Text[Style["P", Italic, Larger], 1.2 ellipsePhi[-3 Pi/4 + Pi/24]]}]
},
 Axes -> False, PlotRange -> 1.3 {{-1, 1}, {-1, 1}}
 ]

which gives you this

enter image description here

Although it is possible to set the angles & arrows precisely, in some places (e.g., 13 Pi/20), I've only roughly approximated it. You really can't tell the difference in the final figure, but if you're picky you can change them and fix the positions exactly.

like image 124
abcd Avatar answered Oct 09 '22 01:10

abcd