Function Repository Resource:

SolarSystemPlot3D

Source Notebook

Plot the positions of solar system objects in 3D

Contributed by: Jeff Bryant

ResourceFunction["SolarSystemPlot3D"][primitives]

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"][primitives,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"][primitives,{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".
If no primitives are given, the result will include the planets and Pluto.
"DeepSpaceProbe" entities must have the "HelioCoordinates" property available.
Entities represent the coordinates of those entities when used within ResourceFunction["SolarSystemPlot3D"].
Units are in astronomical units.
ResourceFunction["SolarSystemPlot3D"] has the same options as Graphics3D, with the following additions and changes:
"EclipticPlaneStyle"Directive[GrayLevel[1],Opacity[0.2]]style to use for drawing the ecliptic plane
"IncludeEclipticPlane"Truewhether to draw the ecliptic plane
"IncludeReferenceObjects"Falsewhether to include important background reference objects
"IncludeSun"Truewhether to include the Sun
LabelingFunctionAutomatichow to label points
LabelingSizeAutomaticsize to use for callout and label
"OrbitsToInclude"Automaticlist of entities whose orbits to include
"OrbitStyle"Automaticstyle to use for drawing orbits
"SunStyle"Automaticstyle directives to use for rendering the Sun

Examples

Basic Examples (5) 

Plot the position of a planet:

In[1]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Red, Sphere[Entity["Planet", "Neptune"], 1]}]
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]}, PlotRangePadding -> 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.`], PlotRangePadding -> 2]
Out[5]=

Scope (2) 

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 (8) 

OrbitsToInclude (1) 

"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 (1) 

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

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

IncludeSun (1) 

"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]=

SunStyle (1) 

"SunStyle" 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 (1) 

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

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

EclipticPlaneStyle (1) 

"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]}, "IncludeEclipticPlane" -> True, "EclipticPlaneStyle" -> Directive[Blue, Opacity[.5]], "IncludeReferenceObjects" -> False, PlotRange -> 1.7]
Out[13]=

LabelingFunction (1) 

Force all callout labels to display:

In[14]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Cyan, Opacity[.2], EdgeForm[], Cone[{1.5 (Entity["Comet", "CometC2022E3ZTF"]), Entity["Comet", "CometC2022E3ZTF"]}, .05]}, DateObject[{2023, 1, 13}], ViewAngle -> Pi/200,
 "SunStyle" -> {Yellow,
   Lighting -> {
     {"Ambient", GrayLevel[.3]},
     {"Directional", White, ImageScaled[{0, 0, 1}]}
     }, Sphere[{0, 0, 0}, .05]}, LabelingFunction -> Callout]
Out[14]=

IncludeReferenceObjects (1) 

"IncludeReferenceObjects" can be set to False to avoid computing the positions of background reference objects:

In[15]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Orange, Sphere[Entity["Planet", "Jupiter"], .3]}, "IncludeReferenceObjects" -> False, PlotRangePadding -> .2]
Out[15]=

Applications (2) 

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

In[16]:=
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}}}, "IncludeReferenceObjects" -> False]]
Out[16]=

Track Elon Musk's Tesla in space:

In[17]:=
With[{tesla = Entity["DeepSpaceProbe", "FalconHeavyDemonstrationMission"]},
 ResourceFunction[
  "SolarSystemPlot3D"][{Text["Tesla", tesla, {-1.5, 0}], PointSize[.02], Red, Point[tesla]}, 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]}]]
Out[17]=

Possible Issues (1) 

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[18]:=
ResourceFunction[
 "SolarSystemPlot3D"][{Green, Sphere[Entity["DeepSpaceProbe", "NEWHorizons"], 1]}, DateObject[{1986, 1, 3}, "Day", "Gregorian", -6.`]]
Out[18]=

Neat Examples (1) 

Simulate the inner planets being illuminated by the Sun:

In[19]:=
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}}}, "IncludeReferenceObjects" -> False]
Out[19]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 5.1.3 – 29 September 2023
  • 5.1.2 – 15 September 2023
  • 5.1.1 – 13 January 2023
  • 5.1.0 – 13 January 2023
  • 5.0.0 – 02 September 2020
  • 4.0.0 – 01 September 2020
  • 3.0.0 – 10 July 2020
  • 2.0.0 – 13 March 2019
  • 1.0.0 – 07 March 2019

License Information