Wolfram Research

Function Repository Resource:

SolarSystemPlot3D

Source Notebook

Plot the positions of solar system objects in 3D

Contributed by: Jeff Bryant

ResourceFunction["SolarSystemPlot3D"][arg]

represents a three-dimensional graphical image for the current date that works with solar system entities as well as standard 3D graphics primitives and directives.

ResourceFunction["SolarSystemPlot3D"][arg,date]

represents a three-dimensional graphical image for the specified date that works with solar system entities as well as standard 3D graphics primitives and directives.

ResourceFunction["SolarSystemPlot3D"][arg,{date1,date2}]

represents a three-dimensional graphical image for the specified range of dates that works with solar system entities as well as standard 3D graphics primitives and directives.

Details and Options

Supported entity types include: "Planet", "MinorPlanet", "Comet" and "DeepSpaceProbe".
"DeepSpaceProbe" entities must have "HelioCoordinates" available.
ResourceFunction["SolarSystemPlot3D"] supports all Graphics3D options, as well as "IncludeSun", "OrbitsToInclude" and "OrbitStyle".
Entities represent the coordinates of those entities when used within ResourceFunction[“SolarSystemPlot3D”].
Units are in astronomical units.

Examples

Basic Examples

Plot the position of a planet:

In[1]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Neptune"], 2]}]
Out[1]=

Plot the position of a minor planet:

In[2]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Pink, Sphere[Entity["MinorPlanet", "Pluto"], 1]}]
Out[2]=

Plot the position of a comet:

In[3]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Red, Sphere[Entity["Comet", "Comet1PHalley"], 1]}]
Out[3]=

Plot the position of a deep space probe:

In[4]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Green, Sphere[Entity["DeepSpaceProbe", "NEWHorizons"], 1]}]
Out[4]=

Plot the position of a planet on a specific date:

In[5]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Neptune"], 2]}, DateObject[{1986, 1, 3}, "Day", "Gregorian", -6.`]]
Out[5]=

Scope

Plot the positions of multiple solar system objects:

In[6]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Neptune"], 2], Pink, Sphere[Entity["MinorPlanet", "Pluto"], 1], Green, Sphere[Entity["DeepSpaceProbe", "NEWHorizons"], 1], Red, Sphere[Entity["Comet", "Comet1PHalley"], 1]}]
Out[6]=

Plot the positions of multiple solar system objects on a specified date:

In[7]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Neptune"], 2], Pink, Sphere[Entity["MinorPlanet", "Pluto"], 1], Red, Sphere[Entity["Comet", "Comet1PHalley"], 1]}, DateObject[{1986, 1, 3}, "Day", "Gregorian", -6.`]]
Out[7]=

Options

OrbitsToInclude

"OrbitsToInclude" can be used to specify which orbits should be included in the scene:

In[8]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Neptune"], 2]}, "OrbitsToInclude" -> {Entity["Planet", "Neptune"], Entity["MinorPlanet", "Pluto"]}]
Out[8]=

OrbitStyle

"OrbitStyle" can be used to style the orbits according to arbitrary styles and directives:

In[9]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Neptune"], 2]}, "OrbitStyle" -> Red]
Out[9]=

IncludeSun

"IncludeSun" can be used to remove the Sun from the scene:

In[10]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Earth"], .1], White, Sphere[Entity["Planet", "Venus"], .1], Gray, Sphere[Entity["Planet", "Mercury"], .1]}, "IncludeSun" -> False, PlotRange -> 1.7]
Out[10]=

SunPrimitives

"SunPrimitives" can be used to change the directives and primitives used to create the Sun. By default, the Sun is drawn to scale as a yellow sphere:

In[11]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Earth"], .1], White, Sphere[Entity["Planet", "Venus"], .1], Gray, Sphere[Entity["Planet", "Mercury"], .1]}, "SunStyle" -> {Red, Lighting -> {{"Ambient", GrayLevel[.3]}, {"Directional", White, ImageScaled[{0, 0, 1}]}}, Sphere[{0, 0, 0}, .1]}, PlotRange -> 1.7]
Out[11]=

IncludeEclipticPlane

"IncludeEclipticPlane" is True by default, but can be set to False:

In[12]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Earth"], .1], White, Sphere[Entity["Planet", "Venus"], .1], Gray, Sphere[Entity["Planet", "Mercury"], .1]}, "IncludeEclipticPlane" -> False, PlotRange -> 1.7]
Out[12]=

EclipticPlaneStyle

"EclipticPlaneStyle" can be used to specify the directives to use in styling the ecliptic plane:

In[13]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Earth"], .1], White, Sphere[Entity["Planet", "Venus"], .1], Gray, Sphere[Entity["Planet", "Mercury"], .1]}, "EclipticPlaneStyle" -> Directive[Blue, Opacity[.5]], PlotRange -> 1.7]
Out[13]=

Applications

Visualize comet 46P/Wirtanen as it passes near the Earth:

In[14]:=
With[{comet = Entity["Comet", "Comet46PWirtanen"]}, ResourceFunction[
  "SolarSystemPlot3D"][{LightBlue, Sphere[Entity["Planet", "Earth"], .02], Cyan, Sphere[comet, .01], EdgeForm[], Cone[{1.1 comet, comet}, .02]}, DateObject[{2018, 12, 15}, "Day", "Gregorian", -6.`], "OrbitStyle" -> Gray, "SunStyle" -> {ColorData["BlackBodySpectrum"][5770], Lighting -> {{"Ambient", GrayLevel[.3]}, {"Directional", White, ImageScaled[{0, 0, 1}]}}, Sphere[{0, 0, 0}, .1]}, Background -> Black, Boxed -> False, PlotRange -> 1.2, SphericalRegion -> True, ViewCenter -> {.6, .85, .5}, ViewAngle -> Pi/20, Lighting -> {{"Point", White, {0, 0, 0}}}, "IncludeEclipticPlane" -> False]]
Out[14]=

Track Elon Musk’s Tesla in space:

In[15]:=
With[{earth = Entity["Planet", "Earth"], mars = Entity["Planet", "Mars"], tesla = Entity["DeepSpaceProbe", "FalconHeavyDemonstrationMission"]},
 ResourceFunction[
  "SolarSystemPlot3D"][{Text["Earth", earth, {0, -2}], Text["Mars", mars, {0, -2}], Text["Tesla", tesla, {-1.5, 0}], PointSize[.02], Blue, Point[earth], Red, Point[tesla], Point[mars]}, DateObject[{2020, 9, 1}], PlotRange -> 2.1, ViewPoint -> Above, Boxed -> False, ViewAngle -> Pi/7, "SunStyle" -> {Hue[.14], Lighting -> {{"Ambient", GrayLevel[.3]}, {"Directional", White, ImageScaled[{0, 0, 1}]}}, Sphere[{0, 0, 0}, .1]}, "IncludeEclipticPlane" -> False]]
Out[15]=

Possible Issues

The coordinates of some objects may not be available or may have restrictions on which dates they are available, which can result in invalid coordinates for a 3D scene:

In[16]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Green, Sphere[Entity["DeepSpaceProbe", "NEWHorizons"], 1]}, DateObject[{1986, 1, 3}, "Day", "Gregorian", -6.`]]
Out[16]=

Neat Examples

Simulate the inner planets being illuminated by the Sun:

In[17]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Blue, Sphere[Entity["Planet", "Earth"], .1], White, Sphere[Entity["Planet", "Venus"], .1], Gray, Sphere[Entity["Planet", "Mercury"], .1]}, PlotRange -> 1.7, ViewPoint -> Top, Boxed -> False, Background -> Black, "OrbitStyle" -> Gray, Lighting -> {{"Ambient", GrayLevel[.2]}, {"Point", White, {0, 0, 0}}}, "IncludeEclipticPlane" -> False]
Out[17]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information