I'm simulating the Sun-Earth-Moon system by numerical integration of equation of motion. I've confused a little bit in JPL Horizons ephemerides.

Could anyone explain (if possible, on pictures), how to use it to achieve

  • Earth coordinates in Sun coordinate system or in Solar system baricenter coordinate system
  • Sun coordinates in Solar system baricenter coordinate system
  • Moon coordinates in Earth coordinate system

3 Answers 3


For quick and easy experimenting with NASA Horizons, I set up a page:


I also tried explaining the possible "quantities" (for "OBSERVER" table) visually rather than by text like in original documentation, as it is very hard to describe by text a graphical concept (it looks like Horizons help dates back to DOS epoch...)


For VECTOR table, my interface is also useful because it allows immediately viewing the output on the same window:

Data received

For VECTOR table I also setup a specific page which allows plotting in 2d and 3d the trajectory of any body w.r.t. any other; it was designed to track spacecrafts, but of course it works also for planets and satellites:



  • orbiter=301 (moon)
  • center=@399 (earth)
  • start=2021-07-15 (start time)
  • stop=2021-08-16 (end time)
  • step=1d (time step)
  • 3dzoom=500000 (zoom of 3d plot, in km)
  • radius=6000 (radius of center body, in km, for calculating altitude in 2d plot)

3d+2d plots

ID#      Name                               Designation  IAU/aliases/other   
  -------  ---------------------------------- -----------  ------------------- 
        0  Solar System Barycenter                         SSB                     
        3  Earth-Moon Barycenter                           EMB                                    
       10  Sun                                             Sol                       
      301  Moon                                            Luna                 
      399  Earth                                           Geocenter  

Full list of known bodies: https://ssd.jpl.nasa.gov/horizons_batch.cgi?batch=1&COMMAND=%27*%27&CENTER=%27*%27


Keywords: Horizons tutorial

I'll work one example all the way through, and include the exact output you should get so you can check your results.

Then you can change one item at a time to get the rest of the things you need.

Go to https://ssd.jpl.nasa.gov/horizons.cgi

Ephemeris Type

Select the Vector Table:

enter image description here

Target Body

Type the word "Earth" into the search box:

enter image description here

It searches, and finds two options. Choose "Earth Geocenter":

enter image description here

Coordinate Origin

Use observatory code numbers (if you know them) or names. For example, enter "675" to select the Palomar Mountain main site. Or, enter "palomar" for a list of matching sites. Use "Geocentric or code "500" for geocentric. You can also enter Horizons-specific non-topocentric location codes. For example, use "@sun" to place the observer at the center of the sun, "@0" to select the solar-system barycenter, or "Viking 1@499" to select the Viking 1 landing site on Mars (499). To see all sites available for a specific body, use "@body" where body is body ID. For example, "@499" will show all sites on Mars. See the Horizons documentation for more details on center/observer location codes.

"@0" will set your origin to the Solar System Barycenter

enter image description here

Time Span

enter image description here

Table Settings

You need all six values to build your initial state vector: $x, y, z, v_x, v_y, v_z$:

enter image description here

Make all options settings look exactly like this:

enter image description here


Choose HTML so you can see it on your screen. If you like it then change to download/save

enter image description here

If you save the file, and extract the positions of Earth, you get the following. Z stays very close to zero because the reference plane is set to ecliptic.

2458164.500000000, A.D. 2018-Feb-15 00:00:00.0000, 
-1.222658746534817E+08,  8.358147121331073E+07, -1.998641833709925E+04, 
-1.716151037847111E+01, -2.480720984441618E+01,  2.472874945897985E-03,

enter image description here

If you want to use earth mean equator for the reference plane (which is like the equator of the celestial sphere (declination = 0) then you set it to mean equator:

enter image description here

and you'll get this:

2458164.500000000, A.D. 2018-Feb-15 00:00:00.0000, 
-1.222658746534817E+08,  7.669245070020768E+07,  3.322846272752656E+07, 
-1.716151037847111E+01, -2.276115369540082E+01, -9.865472560113437E+00,

enter image description here

  • $\begingroup$ For today, in the coordinate system with center in Solar System Baricenter, the Earth coordinates: X =-7.86E-01 Y = 6.00E-01 Z =-1.37E-04 | Sun coordinates: X = 1.55E-03 Y = 6.33E-03 Z =-1.14E-04.... IS IT OK? $\endgroup$ Commented Feb 14, 2018 at 17:44
  • 1
    $\begingroup$ I don't know where your numbers come from, and it doesn't matter. The numbers that I show in the answer are the output, and you can see the time and date in the beginning. Horizons is pretty much the best you can get anywhere. These are the right numbers! You can run Horizons again and select AU and AU/day if you want, or you can convert these to AU. $\endgroup$
    – uhoh
    Commented Feb 14, 2018 at 17:49
  • $\begingroup$ @TarlanMammadzada no problem! To get good results integrating orbits near Earth, you'll need time steps of the order of a one or two minutes (or less) because the satellite's period is only ~100 minutes. You can get such small steps from Horizons, or you can get larger steps from Horizons and interpolate them. Some day you will wonder how Horizons works, and so I'll tell you now; it's a very big, beautiful, flexible interpolator, and the tables it interpolates are called ephemerides and/or kernels. $\endgroup$
    – uhoh
    Commented Feb 14, 2018 at 18:16
  • 1
    $\begingroup$ @AaronFranke since conversion from kilometers to meters is trivial (multiply by exactly 1000) it seems that NASA trusts us to be able to do it for ourselves. $\endgroup$
    – uhoh
    Commented May 26, 2019 at 13:22
  • 3
    $\begingroup$ @MagicOctopusUrn I am trying to setup such a GUI for Horizons: win98.altervista.org/space/exploration/NHUGUI.html $\endgroup$
    – jumpjack
    Commented Aug 19, 2020 at 15:20

Look at the Vector option. For the target, use the "satellite". For the origin, use the appropriate body id, preferably the Barycenter. Some example IDs:

  • Solar Barycenter- 0
  • Earth Barycenter- 399
  • Mars Barycenter- 499
  • $\begingroup$ Just to ensure. I selected Type- Vector, Targer- Earth, Origin- Baricenter. So, is it coordinates of Earth in Baricenter coordinate system? $\endgroup$ Commented Feb 14, 2018 at 13:54
  • $\begingroup$ Yes, that is correct. $\endgroup$
    – PearsonArtPhoto
    Commented Feb 14, 2018 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.