VSOP87 Multilang

What is VSOP87?

VSOP87 was develped by the Bureau des Longitudes in Paris for computing the positions of the planets (Mercury through Neptune), and version "A" also includes the Earth-Moon barrycenter, which can provide the positon of the Moon. The accuracy according to the authors is 1 arcseconds for a 2000 year period before and after the year 2000. Several different versions are provided, VSOP87, VSOP87A, VSOP87B, VSOP87C, VSOP87D, VSOP87E provide the coordinates in different formats and coordinate systems.

For full details, consult Planetary theories in rectangular and spherical variables - VSOP 87 solutions

Project Overview

The purpose of this project is to provide implementations of the VSOP87 theory in multiple languages at different levels of precision. The source code files are hosted on GitHub: https://github.com/gmiller123456/vsop87-multilang.

Example to Compute Alt/Az and RA/DEC

A JavaScript Example is available. It shows how to compute the RA/DEC of J2000, RA/DEC of Date, and Alt/Az coordinates for an observer on the Earth's surface. The series for nutation and precession have been truncated so they are not overly precise based on the precision of the VSOP87 solution. The error in arcseconds is supplied for many test vectors computed using the JPL Horizons system.

Library Versions

The VSOP87 theory provides methods of computing the planet positions in several different coordinate systems, and each solution may or may not a particular body. The table below outlines what each solution provides and the coordinate system the results are in.

VersionMercuryVenusEarthEMBMarsJupiterSaturnUranusNeptuneSunCoordinates
VSOP87YesYesNoYesYesYesYesYesYesNoKeperian Orbital Elements
VSOP87AYesYesYesYesYesYesYesYesYesNoHeliocentric J2000 Ecliptic Rectangular XYZ
VSOP87BYesYesYesNoYesYesYesYesYesNoHeliocentric J2000 Ecliptic Spherical LBR
VSOP87CYesYesYesNoYesYesYesYesYesNoHeliocentric Ecliptic of date Rectangular XYZ
VSOP87DYesYesYesNoYesYesYesYesYesNoHeliocentric Ecliptic of date Spherical LBR
VSOP87EYesYesYesNoYesYesYesYesYesYesBarycentric J2000 Ecliptic Rectangular XYZ

Further, each solution is broken up into different accuracy levels in each file. In the repository you will see files named vsop87x_vvvvvv.ppp, where x is the solution in the table above, vvvvvv is the accuracy level, and ppp is the extention for a given programming language. You will only need one of these files. If you plan to implement abberation, you will also need the corresponding _velocities file. Since most solutions don't include the positon of the Sun, the coordinate system for those is Heliocentric. So the positon of the Sun, relative to Earth, can be computed by just negating the position vectors for the Earth. The example above shows how to perform this task.

If you're at a loss for where to start, vsop87a_full is likely worth trying first. If it turns out not to be fast enough for your application, consider one of the smaller vsop87a versions.

Using the Library

Eacy library version will contain functions named similar to getEarth(), getMars(), getJupiter(), etc. And VSOP87a contains the special function getMoon() (explained below). Each of these functions accepts one parameter T. T is the number of days in Julain Centuries passed since the year 2000 in the TDB time scale, again, the example above shows how to compute this value.

The special function getMoon() in VSOP87A accepts two parameters, the positon of the Earth, and the Earth-Moon Baryrcenter. It returns the position of the moon in the same coordinate system as VSOP87A.

This short example shows how a typical call to get the positon of the Earth and Moon might go:

 
    const jd=2457987.267731481; //TDB time scale
    const t=(jd - 2451545.0) / 365250.0;
    const earth=vsop878a.getEarth(t);
    const emb=vsop87a.getEmb(t);
    const moon=vsop87a.getMoon(earth,emb);

The result is the varialbes earth, emb, and moon will contain an array of three Doubles which are the J2000 rectangular coordinates of each body in units of AU. Such coordinates are of little use to most people directly, so the example above shows how to convert them into more useful coordinates.

Accuracy

Source code for all versions is provided at the Github repository above, but this graph will focus on VSOP87A, arguably the most useful for amateurs in general. Since the accuracy is far greater than that needed for most amateur applications, it can be useful to truncate the series to save computation time in exchange for lower accuracy.

The interactive graph below is populated with precomputed data from 2000BC to 3000AD. Use the checkboxes to get an idea for the accuracy over a given time period. Note the Moon is unchecked by default, as the "pico", "nano", and "micro" versions are essentially unusable for the Moon for any date range. Keep in mind that you may copy the functions for computing one body into other versions, essentially mixing and matching accuracy editions.

The Y-axis is the error, in degrees, as viewed from the center of the Earth, compared to the full VSOP87a version.

Bodies
 MercuryVenus
MarsJupiterSaturn
UranusNeptuneMoon
Series' Smallest Coefficients
XX LargeX Largelarge
smallxsmallmilli
micronanopico