Pod means Plain Old Documentation and comes from the world of Perl, a programming language similar to PHP. To extract the documenation from this file, type
perldoc sweph.c
see also https://perldoc.perl.org/perlpod
calculate position of planet ipl with time in Ephemeris Time (TDT)
double tjd_et Julian day in Ephemeris Time.
nt ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
[0..5] double position and speed vector xx
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_calc ( double tjd_et, int ipl, int iflag, double* xx, char* serr);
calculate position of planet ipl with time in Universal Time UT
double tjd_ut Julian day in Universal Time.
int ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
[0..5] position and speed vector xx
['serr'] optional error message
['rc'] return flag, < 0 in case of error
int swe_calc_ut ( double tjd_ut, int ipl, int iflag, double* xx, char* serr);
calculate position of planet ipl relative to a center object iplctr
double tjd_et Julian day in Ephemeris Time.
int ipl Target planet/body/object number or constant.
int iplctr Center planet/body/object number or constant.
int iflag Flag bits for computation requirements.
[0..5] double position and speed vector xx
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_calc_pctr ( double tjd_et, int ipl, int iplctr, int iflag, double* xx, char* serr);
computes moment of Sun's crossing over some longitude
double x2cross zodiac position to be crossed
double jd_et start date in Ephemeris Time.
int iflag Flag bits for computation requirements, e.g.
SEFLG_HELCTR (crossing of Earth instead of Sun)
SEFLG_TRUEPOS
SEFLG_NONUT
SEFLG_EQUATORIAL
['jx'] double crossing date/time
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
double swe_solcross(double x2cross, double jd_et, int flag, char *serr)
computes moment of Sun's crossing over some longitude
double x2cross zodiac position to be crossed
double jd_ut start date in Universal Time
int iflag Flag bits for computation requirements, e.g.
SEFLG_HELCTR (crossing of Earth instead of Sun)
SEFLG_TRUEPOS
SEFLG_NONUT
SEFLG_EQUATORIAL
['jx'] double crossing date/time
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
double swe_solcross_ut(double x2cross, double jd_ut, int flag, char *serr)
computes moment of Moon's crossing over some longitude
double x2cross zodiac position to be crossed
double jd_et start date in Ephemeris Time.
int iflag Flag bits for computation requirements, e.g.
SEFLG_HELCTR (crossing of Earth instead of Sun)
SEFLG_TRUEPOS
SEFLG_NONUT
SEFLG_EQUATORIAL
['jx'] double crossing date/time
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
double swe_mooncross(double x2cross, double jd_et, int flag, char *serr)
computes moment of Moon's crossing over some longitude
double x2cross zodiac position to be crossed
double jd_ut start date in Universal Time
int iflag Flag bits for computation requirements, e.g.
SEFLG_HELCTR (crossing of Earth instead of Sun)
SEFLG_TRUEPOS
SEFLG_NONUT
SEFLG_EQUATORIAL
['jx'] double crossing date/time
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
double swe_mooncross_ut(double x2cross, double jd_ut, int flag, char *serr)
computes Moon's crossing its true node, i.e. through zero latitude
double jd_et start date in Ephemeris Time.
int iflag Flag bits for computation requirements, e.g.
['jx'] double crossing date/time
['xlon'] double longitude at crossing time
['xlat'] double latitude at crossing time (very near zero)
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
double swe_mooncross_node(double jd_et, int flag, double *xlon, double *xlat, char *serr)
computes Moon's crossing its true node, i.e. through zero latitude
double jd_ut start date in Universal Time
int iflag Flag bits for computation requirements, e.g.
['jx'] double crossing date/time
['xlon'] double longitude at crossing time
['xlat'] double latitude at crossing time (very near zero)
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
double swe_mooncross_node_ut(double jd_ut, int flag, double *xlon, double *xlat, char *serr)
computes a planet's heliocentric crossing over some longitude
int ipl planet nuber
double x2cross zodiac position to be crossed
double jd_et start date in Ephemeris Time.
int iflag Flag bits for computation requirements, e.g.
SEFLG_TRUEPOS
SEFLG_NONUT
SEFLG_EQUATORIAL
dir int direction of search
>= 0 forward in time
-1 backward in time
['jx'] double crossing date/time
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_helio_cross(int ipl, double x2cross, double jd_et, int iflag, int dir, double *jd_cross, char *serr)
computes a planet's heliocentric crossing over some longitude
int ipl planet nuber
double x2cross zodiac position to be crossed
double jd_ut start date in Universal Time.
int iflag Flag bits for computation requirements, e.g.
SEFLG_TRUEPOS
SEFLG_NONUT
SEFLG_EQUATORIAL
dir int direction of search
>= 0 forward in time
-1 backward in time
['jx'] double crossing date/time
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_helio_cross_ut(int ipl, double x2cross, double jd_ut, int iflag, int dir, double *jd_cross, char *serr)
calculate position of a star with time in Ephemeris Time (TDT)
string star Name of fixed star to be searched, returned name of found star.
double tjd_et Julian day in Ephemeris Time.
int iflag Flag bits for computation requirements.
[0..5] double position and speed vector xx
['star'] string returned star name, usually different from input
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_fixstar(char *star, double tjd_et, int32 iflag, double *xx, char *serr);
calculate position of a star with time in Ephemeris Time (TDT)
string star Name of fixed star, or string with line number in star file
double tjd_et Julian day in Ephemeris Time.
int iflag Flag bits for computation requirements.
[0..5] double position and speed vector xx
['star'] string returned star name, usually different from input
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_fixstar2(char *star, double tjd_et, int32 iflag, double *xx, char *serr);
calculate position of a star with time in Universal Time (UT)
string star Name of fixed star to be searched, returned name of found star.
double tjd_ut Julian day in Universal Time.
int iflag Flag bits for computation requirements.
[0..5] double position and speed vector xx
['star'] string returned star name, usually different from input
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_fixstar_ut(char *star, double tjd_ut, int32 iflag, double *xx, char *serr);
calculate position of a star with time in Universal Time (UT)
string star Name of fixed star, or string with line number in star file
double tjd_ut Julian day in Universal Time.
int iflag Flag bits for computation requirements.
[0..5] double position and speed vector xx
['star'] string returned star name, usually different from input
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_fixstar2_ut(char *star, double tjd_ut, int32 iflag, double *xx, char *serr);
deliver magnitude of star
string star Name of fixed star to be searched
['mag'] double star magnitude, in case of success
['star'] string returned star name, usually different from input
['rc'] int return flag, < 0 in case of error
['serr'] string optional error message
int swe_fixstar_mag(char *star, double *mag, char *serr);
deliver magnitude of star
string star Name of fixed star to be searched
['mag'] double star magnitude, in case of success
['star'] string returned star name, usually different from input
['rc'] int return flag, < 0 in case of error
['serr'] string optional error message
int swe_fixstar2_mag(char *star, double *mag, char *serr);
close SE and release resources
void swe_close()
Define the path where SE ephemeris files reside
string path Single directory name or a list of directories, searched in sequence.
void swe_set_ephe_path(char *path);
Define the file name for a JPL ephemeris file, used with flag SEFLG_JPLEPH
string fname File name of JPL ephemeris (must be sibling of ephemeris files).
void swe_set_jpl_file(char *fname);
get the name of a planet, asteroid or fictitious object
int ipl Planet/body/object number or constant.
In case of error, an error message is returned instead of a planet name.
(char *) swe_get_planet_name(int ipl, char *spname);
Set topocentric reference places, used with flag SEFLG_TOPOCTR and some function
double geolon Longitude of location in degrees.
double geolat Latitude of location in degrees.
double geoalt Altitude of location in meters.
void swe_set_topo(double geolon, double geolat, double geoalt)
Set one of the numerous sidereal modes, used with flag SEFLG_SIDEREAL and some functions
int sid_mode Number of constant of ayanamsa to use.
double t0 Reference date if using SE_SIDM_USER flag, 0 otherwise.
double ayan_t0 Initial value of ayanamsa if using SE_SIDM_USER flag, 0 otherwise.
void swe_set_sid_mode(int32 sid_mode, double t0, double ayan_t0)
Compute the ayanamsa without nutation.
double tjd_et Julian day in Ephemeris Time.
double swe_get_ayanamsa(double tjd_et);
Compute the ayanamsa with or without nutation, depending on flag.
double tjd_et Julian day in Ephemeris Time.
int iflag Flag bits for computation requirements.
[
'daya' => (double) Value of ayanamsa.
'serr' => (string) Error message or empty string.
]
int32 swe_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
Compute the ayanamsa without nutation.
double tjd_ut Julian day in Universal Time.
double
double swe_get_ayanamsa_ut(double tjd_ut);
Get ayanamsa value in current sidereal mode, time in UT
double tjd_ut Julian day in Universal Time.
int iflag Flag bits for computation requirements.
['daya'] double ayanamsa value
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int32 swe_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
Get ayanamsa name for this sidereal mode
int isidmode Number or constant of sidereal mode.
const char *swe_get_ayanamsa_name(int32 isidmode);
find out version number of your Swiss Ephemeris version
Version information of the Swiss Ephemeris library, different from the version of this PHP extension.
char *swe_version(char* svers);
Path to the SE PHP extension library file
string path to currently used library
char *swe_get_library_path(char *spath);
This is a function mostly for debug purposes. It is also useful to find out the time range offered by an asteroid file. The function should only be used directly AFTER a successful call to swe_calc() or swe_fixstar.
It delivers information about the last used file, depending on parameter ifno:
ifno = 0 planet file sepl_xxx, used for Sun .. Pluto, or jpl file
ifno = 1 moon file semo_xxx
ifno = 2 main asteroid file seas_xxx if such an object was computed
ifno = 3 other asteroid or planetary moon file, if such object was computed
ifno = 4 star file
int ifno
['path'] string
['tfstart'] double
['tfend'] double
['denum'] int
In case of error, NULL is returned.
char * swe_get_current_file_data(int ifno, double *tfstart, double *tfend, int *denum);
Converts a calendar date to julian day number tjd, with validity check for date. Parameter cal_flag is a character, j or g, and not the same as the constants SE_GREG_CAL and SE_JUL_CAL used in swe_juldate() and swe_revjul()
int year
int month (1..12)
int day (1..31)
double hour UT (0.0 .. 23.99999) clock time as double
string 'j' or 'g' or string beginning with one of these letters
double|null converted tjd, or in case of illegal input date, NULL.
int swe_date_conversion( int y , int m , int d , double utime, char c, double *tjd);
Converts a calendar date to julian day number tjd, no validity check for date.
int year
int month (1..12)
int day (1..31)
double hour UT (0.0 .. 23.99999) clock time as double
int gregflag SE_GREG_CAL (==1, default) or SE_JUL_CAL (==0)
double converted tjd
double swe_julday(int year, int month, int day, double hour, int gregflag);
Converts julian day number to calendar date
double jd julian day number
int gregflag SE_GREG_CAL (==1, default) or SE_JUL_CAL (==0)
['year'] int
['month'] int
['day'] int
['hour'] double
['ihour'] int
['imin'] int
['isec'] int
['dsec'] double
void swe_revjul ( double jd, int gregflag, int *jyear, int *jmon, int *jday, double *jut);
Converts julian day number / time in Ephemeris time to date and time in UTC
double tjd_et julian day number
int gregflag SE_GREG_CAL (==1) or SE_JUL_CAL (==0)
['year'] int
['month'] int
['day'] int
['hour'] int
['min'] int
['sec'] double
void swe_jdet_to_utc (double tjd_et, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec);
Converts julian day number / time in UT to date and time in UTC
double tjd_ut julian day number and time in UT
int gregflag SE_GREG_CAL (==1) or SE_JUL_CAL (==0)
['year'] int
['month'] int
['day'] int
['hour'] int
['min'] int
['sec'] double
void swe_jdut1_to_utc (double tjd_ut, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec);
Converts a calendar date to julian day number tjd, no validity check for date.
int year
int month (1..12)
int day (1..31)
int hour (0..23)
int min (0..59)
double dsec (0.0 .. 59.99999)
int gregflag SE_GREG_CAL (==1) or SE_JUL_CAL (==0)
In case of success
[0] double jd_et jd in ET (TDT)
[1] double jd_ut jd in UT (UT1)
['rc'] int 0
In case of error
['serr'] string
['rc'] int -1
int swe_utc_to_jd( int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin, double dsec, int32 gregflag, double *dret, char *serr);
Converts a calendar date in a zone with time offset d_timezone into a calendar date in UT (UT1).
int year
int month (1..12)
int day (1..31)
int hour (0..23)
int min (0..59)
double dsec (0.0 .. 59.99999)
double d_timezone offset of time zone to UT, in hours as double
['year'] int
['month'] int
['day'] int
['hour'] int
['min'] int
['sec'] double
void swe_utc_time_zone( int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin, double dsec, double d_timezone, int32 *iyear_out, int32 *imonth_out, int32 *iday_out, int32 *ihour_out, int32 *imin_out, double *dsec_out);
calculated house cusps for given date/time, location and house system
double tjd_ut Julian day in Universal Time.
double geolat latitude -90.00 .. 90.00 (north postive, south negative)
double geolon longitude -180.00 .. 180.00 (east postive, sowest negative)
string hsys first letter indicates house system, default 'P' for Placidus
['cusps'] array of 13 or 37 doubles
['ascmc'] array of 10 doubles
['rc'] int return flag, < 0 in case of error
int swe_houses( double tjd_ut, double geolat, double geolon, int hsys, double *cusps, double *ascmc);
calculated house cusps for given date/time, location and house system
double tjd_ut Julian day in Universal Time.
int iflag
double geolat latitude -90.00 .. 90.00 (north postive, south negative)
double geolon longitude -180.00 .. 180.00 (east postive, sowest negative)
string hsys first letter indicates house system, default 'P' for Placidus
['cusps'] array of 13 or 37 doubles
['ascmc'] array of 10 doubles
['rc'] int return flag, < 0 in case of error
int swe_houses_ex( double tjd_ut, int iflag, double geolat, double geolon, int hsys, double *cusps, double *ascmc);
calculated house cusps for given date/time, location and house system
double tjd_ut Julian day in Universal Time.
int iflag
double geolat latitude -90.00 .. 90.00 (north postive, south negative)
double geolon longitude -180.00 .. 180.00 (east postive, sowest negative)
string hsys first letter indicates house system, default 'P' for Placidus
['cusps'] array of 13 or 37 doubles
['ascmc'] array of 10 doubles
['cusp_speed'] array of 13 or 37 doubles
['ascmc_speed'] array of 10 doubles
['rc'] int return flag, < 0 in case of error
['serr'] string
int swe_houses_ex2( double tjd_ut, int iflag, double geolat, double geolon, int hsys, double *cusps, double *ascmc, double *cusp_speed, double *ascmc_speed, char *serr);
calculated house cusps for given armc, latitude, obliquity and house system
double armc 0.00 .. 360.00
double geolat latitude -90.00 .. 90.00 (north postive, south negative)
double eps obliquity of the ecliptic
string hsys first letter indicates house system, default 'P' for Placidus
['cusps'] array of 13 or 37 doubles
['ascmc'] array of 10 doubles
['rc'] int return flag, < 0 in case of error
int swe_houses_armc( double armc, double geolat, double eps, int hsys, double *cusps, double *ascmc);
calculated house cusps for given armc, latitude, obliquity and house system
double armc 0.00 .. 360.00
double geolat latitude -90.00 .. 90.00 (north postive, south negative)
double eps obliquity of the ecliptic
string hsys first letter indicates house system, default 'P' for Placidus
['cusps'] array of 13 or 37 doubles
['ascmc'] array of 10 doubles
['cusp_speed'] array of 13 or 37 doubles
['ascmc_speed'] array of 10 doubles
['rc'] int return flag, < 0 in case of error
['serr'] string
int swe_houses_armc_ex2( double armc, double geolat, double eps, int hsys, double *cusps, double *ascmc, double *cusp_speed, double *ascmc_speed, char *serr);
calculated house position of object for given armc, latitude, obliquity and house system
double armc 0.00 .. 360.00
double geolat latitude -90.00 .. 90.00 (north postive, south negative)
double eps obliquity of the ecliptic
string hsys first letter indicates house system, default 'P' for Placidus
double xpin0 longitude of object
double xpin1 latitude of object
double house position
or, in case of error
string error message
double swe_house_pos(double armc, double geolat, double eps, int hsys, double *xpin, char *serr)
Get the name of a house system
string hsys first letter indicates house system, default 'P' for Placidus
string name of house system
or fail if system unknown.
char *swe_house_name(int hsys)
finds the gauquelin sector position of a planet or fixed star at given date/time (UT)
tjd_ut double Julian day number, Universal Time.
ipl int Planet
star string Star name, if a star placement is searched
iflag int (specify ephemeris to be used, cf. swe_calc( ))
imeth int method: 0 = with lat., 1 = without lat.,
2 = from rise/set, 3 = from rise/set with refraction
double geolon longitude
double geolat latitude
double geoalt altitude above sea
double atpress atmospheric pressure
double attemp atmospheric temperature
in case of success;
star => (string) Corrected star name, if input starname was given
gsect => (double)
int swe_gauquelin_sector(double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr);
Finds the place on earth where the solar eclipse is maximal at a given time.
Algorithm for the central line is taken from Montenbruck, pp. 179ff., with the exception, that we consider refraction for the maxima of partial and noncentral eclipses. Geographical positions are referred to sea level / the mean ellipsoid.
Errors:
- from uncertainty of JPL-ephemerides (0.01 arcsec):
about 40 meters
- from displacement of shadow points by atmospheric refraction:
a few meters
- from deviation of the geoid from the ellipsoid
a few meters
- from polar motion
a few meters
For geographical locations that are interesting for observation, the error is always < 100 m.
However, if the sun is close to the horizon, all of these errors can grow up to a km or more.
tjd_ut double Julian day number, Universal Time
iflag int (specify ephemeris to be used, cf. swe_calc( ))
retflag => (int) ERR or eclipse type
Function returns as 'retflag':
-1 (ERR) on error (e.g. if swe_calc() for sun or moon fails)
0 if there is no solar eclipse at tjd
SE_ECL_TOTAL
SE_ECL_ANNULAR
SE_ECL_TOTAL | SE_ECL_CENTRAL
SE_ECL_TOTAL | SE_ECL_NONCENTRAL
SE_ECL_ANNULAR | SE_ECL_CENTRAL
SE_ECL_ANNULAR | SE_ECL_NONCENTRAL
SE_ECL_PARTIAL
serr => (string) Error string, on error only
geopos => array of 2 doubles, geogr. position where eclipse is maximal
attr => array of 11 double:
attr[0] fraction of solar diameter covered by moon (magnitude)
attr[1] ratio of lunar diameter to solar one
attr[2] fraction of solar disc covered by moon (obscuration)
attr[3] diameter of core shadow in km
attr[4] azimuth of sun at tjd
attr[5] true altitude of sun above horizon at tjd
attr[6] apparent altitude of sun above horizon at tjd
attr[7] angular distance of moon from sun in degrees
attr[8] magnitude acc. to NASA;
= attr[0] for partial and attr[1] for annular and total eclipses
attr[9] saros series number
attr[10] saros series member number
int swe_sol_eclipse_where( double tjd_ut, int32 ifl, double *geopos, double *attr, char *serr)
Finds the place on earth where the occultation is maximal at a given time.
tjd_ut double Julian day number, Universal Time
ipl int Planet occulted
star string Star name, if a star occultation is searched
iflag int (specify ephemeris to be used, cf. swe_calc( ))
retflag => (int) ERR or eclipse type
There are the following eclipse types for lunar eclipses:
SE_ECL_TOTAL, SE_ECL_PARTIAL, SE_ECL_PENUMBRAL
serr => (string) Error string, on error only
star => (string) Corrected star name
geopos => array of 2 doubles, geogr. position where eclipse is maximal
attr => array of 8 double:
attr[0] fraction of object's diameter covered by moon (magnitude)
attr[1] ratio of lunar diameter to object's diameter
attr[2] fraction of object's disc covered by moon (obscuration)
attr[3] diameter of core shadow in km
attr[4] azimuth of object at tjd
attr[5] true altitude of object above horizon at tjd
attr[6] apparent altitude of object above horizon at tjd
attr[7] angular distance of moon from object in degrees
int swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
Computes attributes of a solar eclipse for given tjd, geo. longitude, geo. latitude, and geo. height.
tjd_ut double Julian day number, Universal Time
iflag int (specify ephemeris to be used, cf. swe_calc( ))
geolng double geographic longitude
geolat double geographic latitude
geoalt double altitude above sea level, in meters
retflag => (int) ERR or eclipse type
SE_ECL_TOTAL or SE_ECL_ANNULAR or SE_ECL_PARTIAL
SE_ECL_NONCENTRAL,
if 0, no eclipse is visible at geogr. position.
serr => (string) Error string, on error only
attr => array of 11 double,
attr[0] fraction of solar diameter covered by moon;
with total/annular eclipses, it results in magnitude acc. to IMCCE.
attr[1] ratio of lunar diameter to solar one
attr[2] fraction of solar disc covered by moon (obscuration)
attr[3] diameter of core shadow in km
attr[4] azimuth of sun at tjd
attr[5] true altitude of sun above horizon at tjd
attr[6] apparent altitude of sun above horizon at tjd
attr[7] elongation of moon in degrees
attr[8] magnitude acc. to NASA;
= attr[0] for partial and attr[1] for annular and total eclipses
attr[9] saros series number
attr[10] saros series member number
int swe_sol_eclipse_how( double tjd_ut, int32 ifl, double *geopos, double *attr, char *serr)
When and how is the next solar eclipse at a given geographical position?
tjd_start double Julian day number, Universal Time
iflag int (specify ephemeris to be used, cf. swe_calc( ))
geopos[0] double geographic longitude
geopos[1] double geographic latitude
geopos[2] double altitude above sea level, in meters
backw int search backward in time
retflag => (int) ERR or eclipse type
SE_ECL_TOTAL or SE_ECL_ANNULAR or SE_ECL_PARTIAL
SE_ECL_VISIBLE,
SE_ECL_MAX_VISIBLE,
SE_ECL_1ST_VISIBLE, SE_ECL_2ND_VISIBLE
SE_ECL_3ST_VISIBLE, SE_ECL_4ND_VISIBLE
serr => (string) Error string, on error only
tret => array of 7 double:
tret[0] time of maximum eclipse
tret[1] time of first contact
tret[2] time of second contact
tret[3] time of third contact
tret[4] time of forth contact
tret[5] time of sun rise between first and forth contact
tret[6] time of sun set beween first and forth contact
attr => array of 11 double,
attr[0] fraction of solar diameter covered by moon;
with total/annular eclipses, it results in magnitude acc. to IMCCE.
attr[1] ratio of lunar diameter to solar one
attr[2] fraction of solar disc covered by moon (obscuration)
attr[3] diameter of core shadow in km
attr[4] azimuth of sun at tjd
attr[5] true altitude of sun above horizon at tjd
attr[6] apparent altitude of sun above horizon at tjd
attr[7] elongation of moon in degrees
attr[8] magnitude acc. to NASA;
= attr[0] for partial and attr[1] for annular and total eclipses
attr[9] saros series number
attr[10] saros series member number
int swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr)
Finds the next occultation of a celestial body (ipl or star) by the moon, for a given place on earth.
There are the following eclipse types for lunar eclipses: SE_ECL_TOTAL, SE_ECL_PARTIAL, SE_ECL_PENUMBRAL
tjd_ut double Julian day number, Universal Time
ipl int Planet occulted
star string|null Star name, if a star occultation is searched
iflag int (specify ephemeris to be used, cf. swe_calc( ))
geopos[0] double geographic longitude
geopos[1] double geographic latitude
geopos[2] double altitude above sea level, in meters
backw int search backward in time
If you want to have only one conjunction
of the moon with the body tested, add the following flag:
backward |= SE_ECL_ONE_TRY. If this flag is not set,
the function will search for an occultation until it
finds one. For bodies with ecliptical latitudes > 5,
the function may search unsuccessfully until it reaches
the end of the ephemeris.
retflag => (int) ERR or eclipse type
serr => (string) Error string, on error only
star => (string) Corrected star name, if input parameter is not null.
tret => array of 10 double:
tret[0] time of maximum eclipse
tret[1]
tret[2] time of partial phase begin (indices consistent with solar eclipses)
tret[3] time of partial phase end
tret[4] time of totality begin
tret[5] time of totality end
tret[6] time of penumbral phase begin
tret[7] time of penumbral phase end
tret[8] time of moonrise, if it occurs during the eclipse
tret[9] time of moonset, if it occurs during the eclipse
attr => array of 20 double, not all are used
attr[0] umbral magnitude at tjd
attr[1] penumbral magnitude
attr[4] azimuth of moon at tjd
attr[5] true altitude of moon above horizon at tjd
attr[6] apparent altitude of moon above horizon at tjd
attr[7] distance of moon from opposition in degrees
attr[8] umbral magnitude at tjd (= attr[0])
attr[9] saros series number (if available; otherwise -99999999)
attr[10] saros series member number (if available; otherwise -99999999)
int swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl,
double *geopos, double *tret, double *attr, int32 backward, char *serr)
When is the next solar eclipse anywhere on earth?
tjd_start double Julian day number, Universal Time
iflag int (specify ephemeris to be used, cf. swe_calc( ))
ifltype int Eclipse type to be searched; 0 if any type of eclipse is wanted
backw int search backward in time
retflag => (int) ERR or eclipse type
returns SE_ECL_TOTAL or SE_ECL_ANNULAR or SE_ECL_PARTIAL or SE_ECL_ANNULAR_TOTAL
SE_ECL_CENTRAL
SE_ECL_NONCENTRAL
serr => (string) Error string, on error only
tret => array of 8 double:
tret[0] time of maximum eclipse
tret[1] time, when eclipse takes place at local apparent noon
tret[2] time of eclipse begin
tret[3] time of eclipse end
tret[4] time of totality begin
tret[5] time of totality end
tret[6] time of center line begin
tret[7] time of center line end
tret[8] Unused/not implemented.
tret[9] Unused/not implemented.
int swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr)
Finds the next occultation of a celestial body (ipl or star) by the moon, no matter where on earth.
There are the following eclipse types for lunar eclipses: SE_ECL_TOTAL, SE_ECL_PARTIAL, SE_ECL_PENUMBRAL
tjd_ut double Julian day number, Universal Time
ipl int Planet occulted
star string|null Star name, if a star occultation is searched
iflag int (specify ephemeris to be used, cf. swe_calc( ))
ifltype int Eclipse type to be searched; 0 if any type of eclipse is wanted
backw int search backward in time
retflag => (int) ERR or eclipse type
serr => (string) Error string, on error only
star => (string) Corrected star name, if input parameter is not null.
geopos => array of 2 doubles, geogr. position where eclipse is maximal
tret => array of 8 double:
tret[0] Time of maximum occultation (UT)
tret[1] time, when eclipse takes place at local apparent noon
tret[2] time of eclipse begin
tret[3] time of eclipse end
tret[4] time of totality begin
tret[5] time of totality end
tret[6] time of center line begin
tret[7] time of center line end
int swe_lun_occult_when_glob( double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr)
Computes attributes of a lunar eclipse for given tjd and geopos
There are the following eclipse types for lunar eclipses: SE_ECL_TOTAL, SE_ECL_PARTIAL, SE_ECL_PENUMBRAL
tjd_ut double Julian day number, Universal Time
iflag int (specify ephemeris to be used, cf. swe_calc( ))
geopos[0] double geographic longitude
geopos[1] double geographic latitude
geopos[2] double altitude above sea level, in meters
If you want to have only one conjunction
of the moon with the body tested, add the following flag:
backward |= SE_ECL_ONE_TRY. If this flag is not set,
the function will search for an occultation until it
finds one. For bodies with ecliptical latitudes > 5,
the function may search unsuccessfully until it reaches
the end of the ephemeris.
retflag => (int) ERR or eclipse type, 0 if no eclipse
serr => (string) in case of error
attr => array of 20 double, not all are used
attr[0] umbral magnitude at tjd
attr[1] penumbral magnitude
attr[4] azimuth of moon at tjd
attr[5] true altitude of moon above horizon at tjd
attr[6] apparent altitude of moon above horizon at tjd
attr[7] distance of moon from opposition in degrees
attr[8] umbral magnitude at tjd (= attr[0])
attr[9] saros series number (if available; otherwise -99999999)
attr[10] saros series member number (if available; otherwise -99999999)
int int32 CALL_CONV swe_lun_eclipse_how( double tjd_ut, int32 ifl, double *geopos, double *attr, char *serr)
When is the next lunar eclipse?
There are the following eclipse types for lunar eclipses: SE_ECL_TOTAL, SE_ECL_PARTIAL, SE_ECL_PENUMBRAL
tjd_ut double Julian day number, Universal Time
iflag int (specify ephemeris to be used, cf. swe_calc( ))
ifltype int Eclipse type to be searched; 0 if any type of eclipse is wanted
backw int search backward in time
retflag => (int) ERR or eclipse type
serr => (string) Error string, on error only
tret => array of 8 double:
tret[0] time of maximum eclipse
tret[1] (unused ?)
tret[2] time of partial phase begin (indices consistent with solar eclipses)
tret[3] time of partial phase end
tret[4] time of totality begin
tret[5] time of totality end
tret[6] time of penumbral phase begin
tret[7] time of penumbral phase end
int swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
When is the next lunar eclipse, observable at a geographic position?
There are the following eclipse types for lunar eclipses: SE_ECL_TOTAL, SE_ECL_PARTIAL, SE_ECL_PENUMBRAL
tjd_start double Julian day number, Universal Time
iflag int (specify ephemeris to be used, cf. swe_calc( ))
geopos[0] double geographic longitude
geopos[1] double geographic latitude
geopos[2] double altitude above sea level, in meters
backw int search backward in time
retflag => (int) ERR or eclipse type
serr => (string) Error string, on error only
tret => array of 10 double:
tret[0] time of maximum eclipse
tret[1] (unused ?)
tret[2] time of partial phase begin (indices consistent with solar eclipses)
tret[3] time of partial phase end
tret[4] time of totality begin
tret[5] time of totality end
tret[6] time of penumbral phase begin
tret[7] time of penumbral phase end
tret[8] time of moonrise, if it occurs during the eclipse
tret[9] time of moonset, if it occurs during the eclipse
attr => array of 11 double, not all are used
attr[0] umbral magnitude at tjd
attr[1] penumbral magnitude
attr[4] azimuth of moon at tjd
attr[5] true altitude of moon above horizon at tjd
attr[6] apparent altitude of moon above horizon at tjd
attr[7] distance of moon from opposition in degrees
attr[8] umbral magnitude at tjd (= attr[0])
attr[9] saros series number (if available; otherwise -99999999)
attr[10] saros series member number (if available; otherwise -99999999)
int swe_lun_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
function calculates planetary phenomena
double tjd_et Julian day in Ephemeris Time.
int ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
retflag => (int) ERR or used iflag bits
serr => (string) Error string, on error only
attr => array of 6 double,
attr[0] = phase angle (earth-planet-sun)
attr[1] = phase (illumined fraction of disc)
attr[2] = elongation of planet
attr[3] = apparent diameter of disc
attr[4] = apparent magnitude
attr[5] = geocentric horizontal parallax (Moon)
int swe_pheno(double tjd_et, int32 ipl, int32 iflag, double *attr, char *serr)
function calculates planetary phenomena
double tjd_ut Julian day in Universal Time.
int ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
retflag => (int) ERR or used iflag bits
serr => (string) Error string, on error only
attr => array of 6 double,
attr[0] = phase angle (earth-planet-sun)
attr[1] = phase (illumined fraction of disc)
attr[2] = elongation of planet
attr[3] = apparent diameter of disc
attr[4] = apparent magnitude
attr[5] = geocentric horizontal parallax (Moon)
int swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr)
Transforms apparent to true altitude and vice-versa.
double inalt altitude of object in degrees
double atpress atmospheric pressure (hectopascal)
double attemp atmospheric temperature °C
int calc_flag either SE_APP_TO_TRUE or SE_TRUE_TO_APP
double converted altitude
double swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag)
Transforms apparent to true altitude and vice-versa.
This function was created thanks to and with the help of the archaeoastronomer Victor Reijs.
It is more correct and more skilled than the old function swe_refrac(): - it allows correct calculation of refraction for altitudes above sea > 0, where the ideal horizon and planets that are visible may have a negative height. (for swe_refrac(), negative apparent heights do not exist!) - it allows to manipulate the refraction constant
double inalt altitude of object in degrees
double geoalt altitude of observer above sea level in meters
double atpress atmospheric pressure (hectopascal)
double attemp atmospheric temperature °C
double lapse_rate (dT/dh) [deg K/m]
int calc_flag either SE_APP_TO_TRUE or SE_TRUE_TO_APP
['rc'] int return code
[0..3] array of 4 doubles:
[0] true altitude, if possible; otherwise input value
[1] apparent altitude, if possible; otherwise input value
[2] refraction
[3] dip of the horizon
double swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret)
Compute heliacal risings etc. of a planet or star.
If this is too much for you, set all these values to 0. The software will then set the following defaults:
- Pressure 1013.25, temperature 15, relative humidity 40. - The values will be modified depending on the altitude of the observer above sea level.
double tjdstart Julian day number of start date for the search, Universal Time.
double geolon Geographic longitude.
double geolat Geographic latitude.
double geoalt Geographic altitude (eye height), in meters.
double atpress Atmospheric pressure in mbar (hPa).
double attemp Atmospheric temperature in C.
double athum Relative humidity in %.
double atuom Unit of measure:
< 1 & > 0, then it is the total atmospheric coefficient (ktot)
0, then other atmospheric parameters determine the total atmospheric coefficient (ktot)
>= 1, then meteorological range (km)
double oage Age of observer in years (default = 36).
double oeyes Snellen ratio of observers eyes (default = 1 = normal).
double omono 0 = monocular, 1 = binocular.
double ozoom Telescope magnification: 0 = default to naked eye (binocular), 1 = naked eye.
double odia Optical aperture (telescope diameter) in mm.
double otrans Optical transmission.
string objectname Name string of fixed star or planet.
int event_type Options:
SE_HELIACAL_RISING (1): morning first (exists for all visible planets and stars);
SE_HELIACAL_SETTING (2): evening last (exists for all visible planets and stars);
SE_EVENING_FIRST (3): evening first (exists for Mercury, Venus, and the Moon);
SE_MORNING_LAST (4): morning last (exists for Mercury, Venus, and the Moon).
int helflag Ephemeris flag, like iflag in swe_calc(). In addition:
SE_HELFLAG_OPTICAL_PARAMS (512);
SE_HELFLAG_NO_DETAILS (1024);
SE_HELFLAG_VISLIM_DARK (4096);
SE_HELFLAG_VISLIM_NOMOON (8192);
array of 3 doubles
[0]: beginning of visibility (Julian day number)
[1]: optimum visibility (Julian day number; 0 if SE_HELFLAG_AV)
[2]: end of visibility (Julian day number; 0 if SE_HELFLAG_AV)
int swe_heliacal_ut(double JDNDaysUTStart, double *dgeo, double *datm, double *dobs, char *ObjectNameIn, int32 TypeEvent, int32 helflag, double *dret, char *serr_ret)
Provides data that are relevant for the calculation of heliacal risings and settings.
This function does not provide data of heliacal risings and settings, just some additional data mostly used for test purposes
Identical to input parameters of swe_heliacal_ut().
array of 30 doubles
see Programmer's manual and C source code in swehel.c
int swe_heliacal_pheno_ut(double JDNDaysUT, double *dgeo, double *datm, double *dobs, char *ObjectNameIn, int32 TypeEvent, int32 helflag, double *darr, char *serr)
Limiting magnitude in dark skies
Identical to input parameters of swe_heliacal_ut(), except no `event_type`.
[
0 => (double) limiting visual magnitude (if dret[0] > magnitude of object, then the object is visible);
1 => (double) altitude of object;
2 => (double) azimuth of object;
3 => (double) altitude of sun;
4 => (double) azimuth of sun;
5 => (double) altitude of moon;
6 => (double) azimuth of moon;
7 => (double) magnitude of object;
]
int swe_vis_limit_mag(double tjdut, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr)
Computes azimut and height, from either ecliptic or equatorial coordinates
double tjd_ut
int calc_flag either SE_ECL2HOR or SE_EQU2HOR
double geolon longitude
double geolat latitude
double geoalt altitude above sea
double atpress atmospheric pressure
double attemp atmospheric temperature
double xin0 longitude of object
double xin1 latitude of object
[0..1] array of 2 doubles:
xaz[0] = azimuth
xaz[1] = true altitude
xaz[2] = apparent altitude
void swe_azalt( double tjd_ut, int32 calc_flag, double *geopos, double atpress, double attemp, double *xin, double *xaz)
computes either ecliptical or equatorial coordinates from azimuth and true altitude in degrees.
double tjd_ut
int calc_flag Either SE_HOR2ECL or SE_HOR2EQU
double lng Longitude position of observer.
double lat Latitude position of observer.
double alt Altitude of observer.
double xin0 azimut, in degrees
double xin1 true altitude, in degrees
array of 2 doubles:
xout[0] = longitude
xout[1] = latitude
void swe_azalt_rev( double tjd_ut, int32 calc_flag, double *geopos, double *xin, double *xout)
rise, set, and meridian transits of sun, moon, planets, and stars
double tjd_ut
int ipl planet number
string starname (used instead of planet if not null or empty)
int epheflag
int rsmi flag combination, defines what is computed
double geolon longitude
double geolat latitude
double geoalt altitude above sea
double atpress atmospheric pressure
double attemp atmospheric temperature
[0..9] array of 10 doubles
['star'] string, present only if starname was used in call parameters
['rc'] int return flag, < 0 in case of error
in case of error
['rc'] int < 0 in case of error
['serr'] string
int swe_rise_trans( double tjd_ut, int32 ipl, char *starname, int32 epheflag, int32 rsmi, double *geopos, double atpress, double attemp, double *tret, char *serr)
rise, set, and meridian transits of sun, moon, planets, and stars
double tjd_ut
int ipl planet number
string starname (used instead of planet if not null or empty)
int epheflag
int rsmi flag combination, defines what is computed
double geolon longitude
double geolat latitude
double geoalt altitude above sea
double atpress atmospheric pressure
double attemp atmospheric temperature
double horhgt height of horizon
[0..9] array of 10 doubles
['star'] string, present only if starname was used in call parameters
['rc'] int return flag, < 0 in case of error
in case of error
['rc'] int < 0 in case of error
['serr'] string
int swe_rise_trans_true_hor( double tjd_ut, int32 ipl, char *starname, int32 epheflag, int32 rsmi, double *geopos, double atpress, double attemp, double horhgt, double *tret, char *serr)
calculate nodes and apsides
Detailed documentation in Programmer's manual and in comments in C source file swecl.
double tjd_et Julian day in Ephemeris Time.
int ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
int method
combination of SE_NODBIT_MEAN, SE_NODBIT_OSCU, SE_NODBIT_OSCU_BAR, SE_NODBIT_FOCAL
according to docu
['retflag'] int return flag, < 0 in case of error
['serr'] string optional error message
['xnasc'] array of 6 doubles
['xndsc'] array of 6 doubles
['xperi'] array of 6 doubles
['xaphe'] array of 6 doubles
int swe_nod_aps(double tjd_et, int32 ipl, int32 iflag, int32 method, double *xnasc, double *xndsc, double *xperi, double *xaphe, char *serr)
calculate nodes and apsides
Detailed documentation in Programmer's manual and in comments in C source file swecl.
double tjd_ut Julian day in Universal Time.
int ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
int method
combination of SE_NODBIT_MEAN, SE_NODBIT_OSCU, SE_NODBIT_OSCU_BAR, SE_NODBIT_FOCAL
according to docu
['retflag'] int return flag, < 0 in case of error
['serr'] string optional error message
['xnasc'] array of 6 doubles
['xndsc'] array of 6 doubles
['xperi'] array of 6 doubles
['xaphe'] array of 6 doubles
int swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag, int32 method, double *xnasc, double *xndsc, double *xperi, double *xaphe, char *serr)
Calculates osculating orbital elements (Kepler elements) of a planet or asteroid or the Earth-Moon barycentre. The function returns error if called for the Sun, the lunar nodes, or the apsides.
double tjd_et Julian day in Ephemeris Time.
int ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
[0..16] array double, with elements
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_get_orbital_elements ( double tjd_et, int ipl, int iflag, double* xx, char* serr);
This function calculates calculates the maximum possible distance, the minimum possible distance, and the current true distance of planet, the EMB, or an asteroid. The calculation can be done either heliocentrically or geocentrically.
double tjd_et Julian day in Ephemeris Time.
int ipl Planet/body/object number or constant.
int iflag Flag bits for computation requirements.
['dmax'] double
['dmin'] double
['dtrue'] double
['serr'] string optional error message
['rc'] int return flag, < 0 in case of error
int swe_orbit_max_min_true_distance ( double tjd_et, int ipl, int iflag, double* xx, char* serr);
Calculate delta t (difference between UT & ET) from Julian day number.
double tjd Julian day in Universal Time.
double Delta T.
double swe_deltat(double tjd);
Calculate delta t (difference between UT & ET) from Julian day number.
If the function is called with SEFLG_SWIEPH before calling swe_set_ephe_path(), or with or SEFLG_JPLEPH before calling swe_set_jpl_file(), then the function returns a warning.
double tjd Julian day in Universal Time.
int ephe_flag Ephemeris flag (one of SEFLG_SWIEPH, SEFLG_JPLEPH, SEFLG_MOSEPH).
[
'dt' => (double) Delta T.
'serr' => (string) Error string.
]
double swe_deltat_ex(double tjd, int32 ephe_flag, char *serr);
Get the difference between local apparent and local mean time.
double tjd_et Julian day in Ephemeris Time.
[
'rd' => (int) Return code.
'td' => (double) Local Apparent Time - Local Mean Time.
'serr' => (string) Error string.
]
int swe_time_equ(double tjd_et, double *e, char *serr);
Converts Local Mean Time (LMT) to Local Apparent Time (LAT).
double tjd_lmt Julian day in Local Mean Time.
double geolon Longitude of geographic location.
[
'rd' => (int) Return code.
'tjd_lat' => (double) Local Apparent Time.
'serr' => (string) Error string.
]
int32 swe_lmt_to_lat(double tjd_lmt, double geolon, double *tjd_lat, char *serr);
Converts Local Apparent Time (LAT) to Local Mean Time (LMT).
double tjd_lat Julian day in Local Apparent Time.
double geolon Longitude of geographic location.
[
'rd' => (int) Return code.
'tjd_lmt' => (double) Local Mean Time.
'serr' => (string) Error string.
]
int32 swe_lat_to_lmt(double tjd_lat, double geolon, double *tjd_lmt, char *serr);
Get sidereal time with user-specified ecliptic obliquity and nutation.
double tjd_ut Julian day in Universal Time.
double eps Obliquity of ecliptic, in degrees.
double nut Nutation in longitude, in degrees.
double Sidereal time in degrees.
double swe_sidtime0(double tjd_ut, double eps, double nut);
Get sidereal time (ecliptic obliquity and nutation calculated internally).
double tjd_ut Julian day in Universal Time.
double Sidereal time in degrees.
double swe_sidtime(double tjd_ut);
Transform coordinates from ecliptic to equatorial, or vice-versa. Convert equatorial to ecliptic if eps is positive. Convert ecliptic to equatorial if eps is negative.
double lng Longitude/right ascension position.
double lat Latitude/declination position.
double dist Distance (ignored).
double eps Obliquity of ecliptic, in degrees.
[
0 => (double) Converted longitude/right ascension position.
1 => (double) Converted latitude/declination position.
2 => (double) distance (unchanged).
]
void swe_cotrans(double *xpo, double *xpn, double eps);
Transform position and speed coordinates from ecliptic to equatorial, or vice-versa. Convert equatorial to ecliptic if eps is positive. Convert ecliptic to equatorial if eps is negative.
double lng Longitude/right ascension.
double lat Latitude/declination.
double dist Distance (ignored).
double lngs Longitude/right ascension velocity.
double lat Latitude/declination velocity.
double dists Distance velocity (ignored).
double eps Obliquity of ecliptic, in degrees.
[
0 => (double) Converted longitude/right ascension value.
1 => (double) Converted latitude/declination value.
2 => (double) distance (unchanged).
3 => (double) Converted longitude/right ascension velocity.
4 => (double) Converted latitude/declination velocity.
5 => (double) distance velocity (unchanged).
]
void swe_cotrans_sp(double *xpo, double *xpn, double eps);
Get tidal acceleration used in swe_deltat().
double Tidal acceleration value.
double swe_get_tid_acc(void);
Set tidal acceleration used in swe_deltat().
double Tidal acceleration.
void swe_set_tid_acc(double t_acc);
Set fixed Delta T value to be returned by swe_deltat().
double Delta T.
void swe_set_delta_t_userdef(double t_acc);
Normalize degrees to the range >= 0 & < 360.
double Degree.
double Normalized degree.
double swe_degnorm(double x);
Normalize radians to the range >= 0 & < 2 PI.
double Radians.
double Normalized radians.
double swe_radnorm(double x);
Calculate a directional midpoint between 2 radian values:
0, 3.14159 => 1.570795 3.14159, 0 => 1.570795
double x1 Starting radian value.
double x2 Ending radian value.
double Midpoint in radians.
double swe_rad_midp(double x1, x0);
Calculate a directional midpoint between 2 degree values:
0,180 => 90 180,0 => 270
double x1 Starting degree value.
double x2 Ending degree value.
double Midpoint in degrees.
double swe_deg_midp(double x1, x0);
This function takes a decimal degree number as input and provides sign or nakshatra, degree, minutes, seconds and fraction of second.
It can also round to seconds, minutes, degrees.
double ddeg Decimal degree value to "split".
int roundflag Default is no rounding; otherwise use flags:
SE_SPLIT_DEG_ROUND_SEC
SE_SPLIT_DEG_ROUND_MIN
SE_SPLIT_DEG_ROUND_DEG
SE_SPLIT_DEG_ZODIACAL
SE_SPLIT_DEG_NAKSHATRA
SE_SPLIT_DEG_KEEP_SIGN
[
'deg' => (int) Integer portion of input value.
'min' => (int) Minute portion of input value (>= 0 < 60).
'sec' => (int) Seconds portion of input value (>= 0 < 60).
'secfr' => (double) Fractional portion of seconds.
'sgn' => (int) Zodiac sign number; or +/- 1.
]
double swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn)
Normalize argument into interval [0..DEG360].
int p Input value to normalize to >=0 & < 360.
long Normalized value.
centisec swe_csnorm(centisec p)
Distance in centisecs p1 - p2 normalized to [0..360].
int p1 Starting position.
int p2 Ending position.
long Normalized distance.
centisec swe_difcsn(centisec p1, centisec p2)
Distance in degrees.
double p1 Starting position.
double p2 Ending position.
double Normalized distance.
double swe_difdegn(double p1, double p2);
Distance in centisecs p1 - p2 normalized to [-180..180].
int p1 Starting position.
int p2 Ending position.
int Normalized distance.
centisec swe_difcs2n(centisec p1, centisec p2);
Distance in degrees p1 - p2 normalized to [-180..180].
double p1 Starting position.
double p2 Ending position.
double Normalized distance.
double swe_difdeg2n(double p1, double p2);
Distance in radians p1 - p2 normalized to [-PI..PI].
double p1 Starting position.
double p2 Ending position.
double Normalized distance.
double swe_difrad2n(double p1, double p2);
Round second, but at 29.5959 always down.
int x Second value.
int Rounded value.
centisec swe_csroundsec(centisec x);
Double to long with rounding, no overflow check.
double x Value to round.
int Rounded value.
long swe_d2l(double x);
Get day of week from Julian day, expressed as integer (0 = Monday, 6 = Sunday).
double jd Julian day number.
int Day of week.
int swe_day_of_week(double jd);
Centiseconds -> time string.
int t Time in centiseconds.
int sep ASCII code of character to use as separator.
int suppressZero Remove trailing zeros (default is to show them).
string Time as string.
char * swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
Centiseconds -> longitude or latitude string.
typical use for longitude: swe_cs2lonlatstr(cs, 'e', 'w')
typical use for latitude: swe_cs2lonlatstr(cs, 'n', 's')
int t Longitude/latitude value in centiseconds.
string pchar Spacing character after degree notation.
string mchar Spacing character after degree notation, if value is negative.
string Longitude/latitude value as string.
char * swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
Centiseconds -> degrees string.
int t Degree value in centiseconds.
string Degree string.
char * swe_cs2degstr(CSEC t, char *a);