New in Wolfram Mathematica 7: Dynamic Astronomical Computation  previous | next 
Plot the Local Group of Galaxies in 3D
The Local Group of galaxies includes the Milky Way, M31 (the Andromeda galaxy), and many dwarf galaxies.
In[1]:=

Click for copyable input
lg = {AstronomicalData[#, "Name"], 

     AstronomicalData[#, "RightAscension"], 

     AstronomicalData[#, "Declination"], 

     AstronomicalData[#, "DistanceLightYears"]} & /@ 

   AstronomicalData["LocalGroup"];
In[2]:=

Click for copyable input
Graphics3D[

 Cases[lg, {nam_, ra_?NumberQ, dec_?NumberQ, dist_?NumberQ} :> 

   Tooltip[Point[{dist Cos[15 ra Degree] Sin[dec Degree + Pi/2], 

      dist Sin[15 ra Degree] Sin[dec Degree + Pi/2], 

      dist Cos[dec Degree + Pi/2]}], nam]]]
Out[2]=