Programming interface to the Swiss Ephemeris

 

Copyright Astrodienst AG 1997-2003.

This document describes the proprietary programmer's interface to the Swiss Ephemeris DLL.

 

Swiss Ephemeris is made available by its authors under a dual licensing  system. The software developer, who uses any part of Swiss Ephemeris  in his or her software, must choose between one of the two license models,   which are

  a) GNU public license version 2 or later

  b) Swiss Ephemeris Professional License

 

The choice must be made before the software developer distributes software  containing parts of Swiss Ephemeris to others, and before any public service using the developed software is activated.

 

If the developer choses the GNU GPL software license, he or she must fulfill the conditions of that license, which includes the obligation to place his or her whole software project under the GNU GPL or a compatible license. See http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

 

If the developer choses the Swiss Ephemeris Professional license, he must follow the instructions as found in http://www.astro.com/swisseph/ and purchase the Swiss Ephemeris Professional Edition from Astrodienst and sign the corresponding license contract.

 


1. The programming steps to get a planet’s position. 5

2. The functions swe_calc_ut() and swe_calc(). 7

2.1. The call parameters. 7

2.2. Error handling and return values. 7

2.3. Bodies ( int ipl ). 8

Additional asteroids. 8

Fictitious planets. 11

Obliquity and nutation. 13

2.4. Options chosen by flag bits (long  iflag). 13

2.4.1. The use of flag bits. 13

2.4.2. Ephemeris flags. 13

2.4.3. Speed flag. 14

2.4.4. Coordinate systems, degrees and radians. 14

2.4.5. Specialties (going beyond common interest). 14

a. True or apparent positions. 14

b. Topocentric positions. 14

c. Heliocentric positions. 14

d. Barycentric positions. 14

e. Astrometric positions. 15

f. True or mean equinox of date. 15

g. J2000 positions and positions referred to other equinoxes. 15

h. Sidereal positions. 15

2.5. Position and Speed (double xx[6]). 15

3. The function swe_get_planet_name(). 15

4. Fixed stars functions. 16

4.1 swe_fixstar_ut. 16

4.2 swe_fixstar(). 16

4.3 swe_fixstar_mag(). 17

5. Apsides functions. 17

5.1 swe_nod_aps_ut. 17

5.2 swe_nod_aps(). 17

6. Eclipse and planetary phenomena functions. 19

6.0. Example of a typical eclipse calculation. 19

6.1. swe_sol_eclipse_when_loc() and swe_lun_occult_when_loc(). 20

6.2. swe_sol_eclipse_when_glob(). 20

6.3. swe_sol_eclipse_how (). 21

6.4. swe_sol_eclipse_where (). 22

6.5. swe_lun_occult_when_loc(). 23

6.6. swe_lun_occult_when_glob(). 24

6.7. swe_lun_occult_where (). 25

6.8. swe_lun_eclipse_when (). 25

6.9. swe_lun_eclipse_how (). 26

6.10. swe_rise_trans(), risings, settings, meridian transits. 27