Reindented Swiss Ephemeris source files for better reabability
This commit is contained in:
parent
b47bc9b4fb
commit
b1b99e0302
2339
swe/src/swecl.c
2339
swe/src/swecl.c
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*********************************************************
|
/*********************************************************
|
||||||
$Header: /home/dieter/sweph/RCS/swedate.c,v 1.75 2009/04/08 07:17:29 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/swedate.c,v 1.75 2009/04/08 07:17:29 dieter Exp $
|
||||||
version 15-feb-89 16:30
|
version 15-feb-89 16:30
|
||||||
@ -7,6 +8,7 @@
|
|||||||
swe_julday()
|
swe_julday()
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -83,15 +85,14 @@
|
|||||||
Return: OK or ERR (for illegal date)
|
Return: OK or ERR (for illegal date)
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
|
|
||||||
# include "swephexp.h"
|
#include "swephexp.h"
|
||||||
# include "sweph.h"
|
#include "sweph.h"
|
||||||
|
|
||||||
static AS_BOOL init_leapseconds_done = FALSE;
|
static AS_BOOL init_leapseconds_done = FALSE;
|
||||||
|
|
||||||
|
|
||||||
int FAR PASCAL_CONV swe_date_conversion(int y,
|
int FAR PASCAL_CONV
|
||||||
int m,
|
swe_date_conversion(int y, int m, int d, /* day, month, year */
|
||||||
int d, /* day, month, year */
|
|
||||||
double uttime, /* UT in hours (decimal) */
|
double uttime, /* UT in hours (decimal) */
|
||||||
char c, /* calendar g[regorian]|j[ulian] */
|
char c, /* calendar g[regorian]|j[ulian] */
|
||||||
double *tjd)
|
double *tjd)
|
||||||
@ -107,7 +108,8 @@ int FAR PASCAL_CONV swe_date_conversion(int y,
|
|||||||
*tjd = jd;
|
*tjd = jd;
|
||||||
if (rmon == m && rday == d && ryear == y) {
|
if (rmon == m && rday == d && ryear == y) {
|
||||||
return OK;
|
return OK;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
} /* end date_conversion */
|
} /* end date_conversion */
|
||||||
@ -161,24 +163,29 @@ int FAR PASCAL_CONV swe_date_conversion(int y,
|
|||||||
and notifies errors like 32 January.
|
and notifies errors like 32 January.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
double FAR PASCAL_CONV swe_julday(int year, int month, int day, double hour, int gregflag)
|
double FAR PASCAL_CONV
|
||||||
|
swe_julday(int year, int month, int day, double hour, int gregflag)
|
||||||
{
|
{
|
||||||
double jd;
|
double jd;
|
||||||
double u,u0,u1,u2;
|
double u, u0, u1, u2;
|
||||||
u = year;
|
u = year;
|
||||||
if (month < 3) u -=1;
|
if (month < 3)
|
||||||
|
u -= 1;
|
||||||
u0 = u + 4712.0;
|
u0 = u + 4712.0;
|
||||||
u1 = month + 1.0;
|
u1 = month + 1.0;
|
||||||
if (u1 < 4) u1 += 12.0;
|
if (u1 < 4)
|
||||||
jd = floor(u0*365.25)
|
u1 += 12.0;
|
||||||
+ floor(30.6*u1+0.000001)
|
jd = floor(u0 * 365.25)
|
||||||
+ day + hour/24.0 - 63.5;
|
+ floor(30.6 * u1 + 0.000001)
|
||||||
|
+ day + hour / 24.0 - 63.5;
|
||||||
if (gregflag == SE_GREG_CAL) {
|
if (gregflag == SE_GREG_CAL) {
|
||||||
u2 = floor(fabs(u) / 100) - floor(fabs(u) / 400);
|
u2 = floor(fabs(u) / 100) - floor(fabs(u) / 400);
|
||||||
if (u < 0.0) u2 = -u2;
|
if (u < 0.0)
|
||||||
|
u2 = -u2;
|
||||||
jd = jd - u2 + 2;
|
jd = jd - u2 + 2;
|
||||||
if ((u < 0.0) && (u/100 == floor(u/100)) && (u/400 != floor(u/400)))
|
if ((u < 0.0) && (u / 100 == floor(u / 100))
|
||||||
jd -=1;
|
&& (u / 400 != floor(u / 400)))
|
||||||
|
jd -= 1;
|
||||||
}
|
}
|
||||||
return jd;
|
return jd;
|
||||||
}
|
}
|
||||||
@ -202,24 +209,27 @@ double FAR PASCAL_CONV swe_julday(int year, int month, int day, double hour, int
|
|||||||
Original author Mark Pottenger, Los Angeles.
|
Original author Mark Pottenger, Los Angeles.
|
||||||
with bug fix for year < -4711 16-aug-88 Alois Treindl
|
with bug fix for year < -4711 16-aug-88 Alois Treindl
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void FAR PASCAL_CONV swe_revjul (double jd, int gregflag,
|
void FAR PASCAL_CONV
|
||||||
int *jyear, int *jmon, int *jday, double *jut)
|
swe_revjul(double jd, int gregflag, int *jyear, int *jmon, int *jday,
|
||||||
|
double *jut)
|
||||||
{
|
{
|
||||||
double u0,u1,u2,u3,u4;
|
double u0, u1, u2, u3, u4;
|
||||||
u0 = jd + 32082.5;
|
u0 = jd + 32082.5;
|
||||||
if (gregflag == SE_GREG_CAL) {
|
if (gregflag == SE_GREG_CAL) {
|
||||||
u1 = u0 + floor (u0/36525.0) - floor (u0/146100.0) - 38.0;
|
u1 = u0 + floor(u0 / 36525.0) - floor(u0 / 146100.0) - 38.0;
|
||||||
if (jd >= 1830691.5) u1 +=1;
|
if (jd >= 1830691.5)
|
||||||
u0 = u0 + floor (u1/36525.0) - floor (u1/146100.0) - 38.0;
|
u1 += 1;
|
||||||
|
u0 = u0 + floor(u1 / 36525.0) - floor(u1 / 146100.0) - 38.0;
|
||||||
}
|
}
|
||||||
u2 = floor (u0 + 123.0);
|
u2 = floor(u0 + 123.0);
|
||||||
u3 = floor ( (u2 - 122.2) / 365.25);
|
u3 = floor((u2 - 122.2) / 365.25);
|
||||||
u4 = floor ( (u2 - floor (365.25 * u3) ) / 30.6001);
|
u4 = floor((u2 - floor(365.25 * u3)) / 30.6001);
|
||||||
*jmon = (int) (u4 - 1.0);
|
*jmon = (int)(u4 - 1.0);
|
||||||
if (*jmon > 12) *jmon -= 12;
|
if (*jmon > 12)
|
||||||
*jday = (int) (u2 - floor (365.25 * u3) - floor (30.6001 * u4));
|
*jmon -= 12;
|
||||||
*jyear = (int) (u3 + floor ( (u4 - 2.0) / 12.0) - 4800);
|
*jday = (int)(u2 - floor(365.25 * u3) - floor(30.6001 * u4));
|
||||||
*jut = (jd - floor (jd + 0.5) + 0.5) * 24.0;
|
*jyear = (int)(u3 + floor((u4 - 2.0) / 12.0) - 4800);
|
||||||
|
*jut = (jd - floor(jd + 0.5) + 0.5) * 24.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* transform local time to UTC or UTC to local time
|
/* transform local time to UTC or UTC to local time
|
||||||
@ -236,13 +246,11 @@ void FAR PASCAL_CONV swe_revjul (double jd, int gregflag,
|
|||||||
* For conversion from local time to utc, use +d_timezone.
|
* For conversion from local time to utc, use +d_timezone.
|
||||||
* For conversion from utc to local time, use -d_timezone.
|
* For conversion from utc to local time, use -d_timezone.
|
||||||
*/
|
*/
|
||||||
void FAR PASCAL_CONV swe_utc_time_zone(
|
void FAR PASCAL_CONV
|
||||||
int32 iyear, int32 imonth, int32 iday,
|
swe_utc_time_zone(int32 iyear, int32 imonth, int32 iday, int32 ihour,
|
||||||
int32 ihour, int32 imin, double dsec,
|
int32 imin, double dsec, double d_timezone,
|
||||||
double d_timezone,
|
int32 * iyear_out, int32 * imonth_out, int32 * iday_out,
|
||||||
int32 *iyear_out, int32 *imonth_out, int32 *iday_out,
|
int32 * ihour_out, int32 * imin_out, double *dsec_out)
|
||||||
int32 *ihour_out, int32 *imin_out, double *dsec_out
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
double tjd, d;
|
double tjd, d;
|
||||||
AS_BOOL have_leapsec = FALSE;
|
AS_BOOL have_leapsec = FALSE;
|
||||||
@ -251,7 +259,7 @@ void FAR PASCAL_CONV swe_utc_time_zone(
|
|||||||
have_leapsec = TRUE;
|
have_leapsec = TRUE;
|
||||||
dsec -= 1.0;
|
dsec -= 1.0;
|
||||||
}
|
}
|
||||||
dhour = ((double) ihour) + ((double) imin) / 60.0 + dsec / 3600.0;
|
dhour = ((double)ihour) + ((double)imin) / 60.0 + dsec / 3600.0;
|
||||||
tjd = swe_julday(iyear, imonth, iday, 0, SE_GREG_CAL);
|
tjd = swe_julday(iyear, imonth, iday, 0, SE_GREG_CAL);
|
||||||
dhour -= d_timezone;
|
dhour -= d_timezone;
|
||||||
if (dhour < 0.0) {
|
if (dhour < 0.0) {
|
||||||
@ -263,10 +271,10 @@ void FAR PASCAL_CONV swe_utc_time_zone(
|
|||||||
dhour -= 24.0;
|
dhour -= 24.0;
|
||||||
}
|
}
|
||||||
swe_revjul(tjd + 0.001, SE_GREG_CAL, iyear_out, imonth_out, iday_out, &d);
|
swe_revjul(tjd + 0.001, SE_GREG_CAL, iyear_out, imonth_out, iday_out, &d);
|
||||||
*ihour_out = (int) dhour;
|
*ihour_out = (int)dhour;
|
||||||
d = (dhour - (double) *ihour_out) * 60;
|
d = (dhour - (double)*ihour_out) * 60;
|
||||||
*imin_out = (int) d;
|
*imin_out = (int)d;
|
||||||
*dsec_out = (d - (double) *imin_out) * 60;
|
*dsec_out = (d - (double)*imin_out) * 60;
|
||||||
if (have_leapsec)
|
if (have_leapsec)
|
||||||
*dsec_out += 1.0;
|
*dsec_out += 1.0;
|
||||||
}
|
}
|
||||||
@ -279,38 +287,40 @@ void FAR PASCAL_CONV swe_utc_time_zone(
|
|||||||
#define NLEAP_SECONDS 24
|
#define NLEAP_SECONDS 24
|
||||||
#define NLEAP_SECONDS_SPACE 100
|
#define NLEAP_SECONDS_SPACE 100
|
||||||
static int leap_seconds[NLEAP_SECONDS_SPACE] = {
|
static int leap_seconds[NLEAP_SECONDS_SPACE] = {
|
||||||
19720630,
|
19720630,
|
||||||
19721231,
|
19721231,
|
||||||
19731231,
|
19731231,
|
||||||
19741231,
|
19741231,
|
||||||
19751231,
|
19751231,
|
||||||
19761231,
|
19761231,
|
||||||
19771231,
|
19771231,
|
||||||
19781231,
|
19781231,
|
||||||
19791231,
|
19791231,
|
||||||
19810630,
|
19810630,
|
||||||
19820630,
|
19820630,
|
||||||
19830630,
|
19830630,
|
||||||
19850630,
|
19850630,
|
||||||
19871231,
|
19871231,
|
||||||
19891231,
|
19891231,
|
||||||
19901231,
|
19901231,
|
||||||
19920630,
|
19920630,
|
||||||
19930630,
|
19930630,
|
||||||
19940630,
|
19940630,
|
||||||
19951231,
|
19951231,
|
||||||
19970630,
|
19970630,
|
||||||
19981231,
|
19981231,
|
||||||
20051231,
|
20051231,
|
||||||
20081231,
|
20081231,
|
||||||
0 /* keep this 0 as end mark */
|
0 /* keep this 0 as end mark */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define J1972 2441317.5
|
#define J1972 2441317.5
|
||||||
#define NLEAP_INIT 10
|
#define NLEAP_INIT 10
|
||||||
|
|
||||||
/* Read additional leap second dates from external file, if given.
|
/* Read additional leap second dates from external file, if given.
|
||||||
*/
|
*/
|
||||||
static int init_leapsec(void)
|
static int
|
||||||
|
init_leapsec(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int ndat, ndat_last;
|
int ndat, ndat_last;
|
||||||
@ -323,11 +333,13 @@ static int init_leapsec(void)
|
|||||||
tabsiz = NLEAP_SECONDS;
|
tabsiz = NLEAP_SECONDS;
|
||||||
ndat_last = leap_seconds[NLEAP_SECONDS - 1];
|
ndat_last = leap_seconds[NLEAP_SECONDS - 1];
|
||||||
/* no error message if file is missing */
|
/* no error message if file is missing */
|
||||||
if ((fp = swi_fopen(-1, "seleapsec.txt", swed.ephepath, NULL)) == NULL)
|
if ((fp =
|
||||||
|
swi_fopen(-1, "seleapsec.txt", swed.ephepath, NULL)) == NULL)
|
||||||
return NLEAP_SECONDS;
|
return NLEAP_SECONDS;
|
||||||
while(fgets(s, AS_MAXCH, fp) != NULL) {
|
while (fgets(s, AS_MAXCH, fp) != NULL) {
|
||||||
sp = s;
|
sp = s;
|
||||||
while (*sp == ' ' || *sp == '\t') sp++;
|
while (*sp == ' ' || *sp == '\t')
|
||||||
|
sp++;
|
||||||
sp++;
|
sp++;
|
||||||
if (*sp == '#' || *sp == '\n')
|
if (*sp == '#' || *sp == '\n')
|
||||||
continue;
|
continue;
|
||||||
@ -340,7 +352,8 @@ static int init_leapsec(void)
|
|||||||
leap_seconds[tabsiz] = ndat;
|
leap_seconds[tabsiz] = ndat;
|
||||||
tabsiz++;
|
tabsiz++;
|
||||||
}
|
}
|
||||||
if (tabsiz > NLEAP_SECONDS) leap_seconds[tabsiz] = 0; /* end mark */
|
if (tabsiz > NLEAP_SECONDS)
|
||||||
|
leap_seconds[tabsiz] = 0; /* end mark */
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return tabsiz;
|
return tabsiz;
|
||||||
}
|
}
|
||||||
@ -374,7 +387,9 @@ static int init_leapsec(void)
|
|||||||
* the leap seconds table (or the Swiss Ephemeris version) is not updated
|
* the leap seconds table (or the Swiss Ephemeris version) is not updated
|
||||||
* for a long time.
|
* for a long time.
|
||||||
*/
|
*/
|
||||||
int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin, double dsec, int32 gregflag, double *dret, char *serr)
|
int32 FAR PASCAL_CONV
|
||||||
|
swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin,
|
||||||
|
double dsec, int32 gregflag, double *dret, char *serr)
|
||||||
{
|
{
|
||||||
double tjd_ut1, tjd_et, tjd_et_1972, dhour, d;
|
double tjd_ut1, tjd_et, tjd_et_1972, dhour, d;
|
||||||
int iyear2, imonth2, iday2;
|
int iyear2, imonth2, iday2;
|
||||||
@ -386,18 +401,18 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||||||
swe_revjul(tjd_ut1, gregflag, &iyear2, &imonth2, &iday2, &d);
|
swe_revjul(tjd_ut1, gregflag, &iyear2, &imonth2, &iday2, &d);
|
||||||
if (iyear != iyear2 || imonth != imonth2 || iday != iday2) {
|
if (iyear != iyear2 || imonth != imonth2 || iday != iday2) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "invalid date: year = %d, month = %d, day = %d", iyear, imonth, iday);
|
sprintf(serr, "invalid date: year = %d, month = %d, day = %d",
|
||||||
|
iyear, imonth, iday);
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
if (ihour < 0 || ihour > 23
|
if (ihour < 0 || ihour > 23 || imin < 0 || imin > 59 || dsec < 0
|
||||||
|| imin < 0 || imin > 59
|
|| dsec >= 61 || (dsec >= 60
|
||||||
|| dsec < 0 || dsec >= 61
|
&& (imin < 59 || ihour < 23 || tjd_ut1 < J1972))) {
|
||||||
|| (dsec >= 60 && (imin < 59 || ihour < 23 || tjd_ut1 < J1972))) {
|
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "invalid time: %d:%d:%.2f", ihour, imin, dsec);
|
sprintf(serr, "invalid time: %d:%d:%.2f", ihour, imin, dsec);
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
dhour = (double) ihour + ((double) imin) / 60.0 + dsec / 3600.0;
|
dhour = (double)ihour + ((double)imin) / 60.0 + dsec / 3600.0;
|
||||||
/*
|
/*
|
||||||
* before 1972, we treat input date as UT1
|
* before 1972, we treat input date as UT1
|
||||||
*/
|
*/
|
||||||
@ -431,7 +446,7 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||||||
* Check, if delta_t - nleap - 32.184 > 0.9
|
* Check, if delta_t - nleap - 32.184 > 0.9
|
||||||
*/
|
*/
|
||||||
d = swe_deltat(tjd_ut1) * 86400.0;
|
d = swe_deltat(tjd_ut1) * 86400.0;
|
||||||
if (d - (double) nleap - 32.184 >= 1.0) {
|
if (d - (double)nleap - 32.184 >= 1.0) {
|
||||||
dret[1] = tjd_ut1 + dhour / 24.0;
|
dret[1] = tjd_ut1 + dhour / 24.0;
|
||||||
dret[0] = dret[1] + swe_deltat(dret[1]);
|
dret[0] = dret[1] + swe_deltat(dret[1]);
|
||||||
return OK;
|
return OK;
|
||||||
@ -449,7 +464,8 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||||||
}
|
}
|
||||||
if (j != 1) {
|
if (j != 1) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "invalid time (no leap second!): %d:%d:%.2f", ihour, imin, dsec);
|
sprintf(serr, "invalid time (no leap second!): %d:%d:%.2f",
|
||||||
|
ihour, imin, dsec);
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -459,10 +475,10 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||||||
/* the number of days between input date and 1 jan 1972: */
|
/* the number of days between input date and 1 jan 1972: */
|
||||||
d = tjd_ut1 - J1972;
|
d = tjd_ut1 - J1972;
|
||||||
/* SI time since 1972, ignoring leap seconds: */
|
/* SI time since 1972, ignoring leap seconds: */
|
||||||
d += (double) ihour / 24.0 + (double) imin / 1440.0 + dsec / 86400.0;
|
d += (double)ihour / 24.0 + (double)imin / 1440.0 + dsec / 86400.0;
|
||||||
/* ET (TT) */
|
/* ET (TT) */
|
||||||
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
|
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
|
||||||
tjd_et = tjd_et_1972 + d + ((double) (nleap - NLEAP_INIT)) / 86400.0;
|
tjd_et = tjd_et_1972 + d + ((double)(nleap - NLEAP_INIT)) / 86400.0;
|
||||||
d = swe_deltat(tjd_et);
|
d = swe_deltat(tjd_et);
|
||||||
tjd_ut1 = tjd_et - swe_deltat(tjd_et - d);
|
tjd_ut1 = tjd_et - swe_deltat(tjd_et - d);
|
||||||
dret[0] = tjd_et;
|
dret[0] = tjd_et;
|
||||||
@ -484,7 +500,9 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||||||
* the leap seconds table (or the Swiss Ephemeris version) has not been
|
* the leap seconds table (or the Swiss Ephemeris version) has not been
|
||||||
* updated for a long time.
|
* updated for a long time.
|
||||||
*/
|
*/
|
||||||
void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
|
void FAR PASCAL_CONV
|
||||||
|
swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 * iyear, int32 * imonth,
|
||||||
|
int32 * iday, int32 * ihour, int32 * imin, double *dsec)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int second_60 = 0;
|
int second_60 = 0;
|
||||||
@ -499,10 +517,10 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||||||
if (tjd_et < tjd_et_1972) {
|
if (tjd_et < tjd_et_1972) {
|
||||||
swe_revjul(tjd_ut, gregflag, iyear, imonth, iday, &d);
|
swe_revjul(tjd_ut, gregflag, iyear, imonth, iday, &d);
|
||||||
*ihour = (int32) d;
|
*ihour = (int32) d;
|
||||||
d -= (double) *ihour;
|
d -= (double)*ihour;
|
||||||
d *= 60;
|
d *= 60;
|
||||||
*imin = (int32) d;
|
*imin = (int32) d;
|
||||||
*dsec = (d - (double) *imin) * 60.0;
|
*dsec = (d - (double)*imin) * 60.0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -510,7 +528,7 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||||||
* second
|
* second
|
||||||
*/
|
*/
|
||||||
tabsiz_nleap = init_leapsec();
|
tabsiz_nleap = init_leapsec();
|
||||||
swe_revjul(tjd_ut-1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
|
swe_revjul(tjd_ut - 1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
|
||||||
ndat = iyear2 * 10000 + imonth2 * 100 + iday2;
|
ndat = iyear2 * 10000 + imonth2 * 100 + iday2;
|
||||||
nleap = 0;
|
nleap = 0;
|
||||||
for (i = 0; i < tabsiz_nleap; i++) {
|
for (i = 0; i < tabsiz_nleap; i++) {
|
||||||
@ -525,25 +543,29 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||||||
imonth2 = (i % 10000) / 100;;
|
imonth2 = (i % 10000) / 100;;
|
||||||
iday2 = i % 100;
|
iday2 = i % 100;
|
||||||
tjd = swe_julday(iyear2, imonth2, iday2, 0, SE_GREG_CAL);
|
tjd = swe_julday(iyear2, imonth2, iday2, 0, SE_GREG_CAL);
|
||||||
swe_revjul(tjd+1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
|
swe_revjul(tjd + 1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
|
||||||
swe_utc_to_jd(iyear2,imonth2,iday2, 0, 0, 0, SE_GREG_CAL, dret, NULL);
|
swe_utc_to_jd(iyear2, imonth2, iday2, 0, 0, 0, SE_GREG_CAL, dret,
|
||||||
|
NULL);
|
||||||
d = tjd_et - dret[0];
|
d = tjd_et - dret[0];
|
||||||
if (d >= 0) {
|
if (d >= 0) {
|
||||||
nleap++;
|
nleap++;
|
||||||
} else if (d < 0 && d > -1.0/86400.0) {
|
}
|
||||||
|
else if (d < 0 && d > -1.0 / 86400.0) {
|
||||||
second_60 = 1;
|
second_60 = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* UTC, still unsure about one leap second
|
* UTC, still unsure about one leap second
|
||||||
*/
|
*/
|
||||||
tjd = J1972 + (tjd_et - tjd_et_1972) - ((double) nleap + second_60) / 86400.0;
|
tjd =
|
||||||
|
J1972 + (tjd_et - tjd_et_1972) - ((double)nleap +
|
||||||
|
second_60) / 86400.0;
|
||||||
swe_revjul(tjd, SE_GREG_CAL, iyear, imonth, iday, &d);
|
swe_revjul(tjd, SE_GREG_CAL, iyear, imonth, iday, &d);
|
||||||
*ihour = (int32) d;
|
*ihour = (int32) d;
|
||||||
d -= (double) *ihour;
|
d -= (double)*ihour;
|
||||||
d *= 60;
|
d *= 60;
|
||||||
*imin = (int32) d;
|
*imin = (int32) d;
|
||||||
*dsec = (d - (double) *imin) * 60.0 + second_60;
|
*dsec = (d - (double)*imin) * 60.0 + second_60;
|
||||||
/*
|
/*
|
||||||
* For input dates > today:
|
* For input dates > today:
|
||||||
* If leap seconds table is not up to date, we'd better interpret the
|
* If leap seconds table is not up to date, we'd better interpret the
|
||||||
@ -552,13 +574,13 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||||||
*/
|
*/
|
||||||
d = swe_deltat(tjd_et);
|
d = swe_deltat(tjd_et);
|
||||||
d = swe_deltat(tjd_et - d);
|
d = swe_deltat(tjd_et - d);
|
||||||
if (d * 86400.0 - (double) (nleap + NLEAP_INIT) - 32.184 >= 1.0) {
|
if (d * 86400.0 - (double)(nleap + NLEAP_INIT) - 32.184 >= 1.0) {
|
||||||
swe_revjul(tjd_et - d, SE_GREG_CAL, iyear, imonth, iday, &d);
|
swe_revjul(tjd_et - d, SE_GREG_CAL, iyear, imonth, iday, &d);
|
||||||
*ihour = (int32) d;
|
*ihour = (int32) d;
|
||||||
d -= (double) *ihour;
|
d -= (double)*ihour;
|
||||||
d *= 60;
|
d *= 60;
|
||||||
*imin = (int32) d;
|
*imin = (int32) d;
|
||||||
*dsec = (d - (double) *imin) * 60.0;
|
*dsec = (d - (double)*imin) * 60.0;
|
||||||
}
|
}
|
||||||
if (gregflag == SE_JUL_CAL) {
|
if (gregflag == SE_JUL_CAL) {
|
||||||
tjd = swe_julday(*iyear, *imonth, *iday, 0, SE_GREG_CAL);
|
tjd = swe_julday(*iyear, *imonth, *iday, 0, SE_GREG_CAL);
|
||||||
@ -580,7 +602,9 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||||||
* the leap seconds table (or the Swiss Ephemeris version) has not been
|
* the leap seconds table (or the Swiss Ephemeris version) has not been
|
||||||
* updated for a long time.
|
* updated for a long time.
|
||||||
*/
|
*/
|
||||||
void FAR PASCAL_CONV swe_jdut1_to_utc(double tjd_ut, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
|
void FAR PASCAL_CONV
|
||||||
|
swe_jdut1_to_utc(double tjd_ut, int32 gregflag, int32 * iyear, int32 * imonth,
|
||||||
|
int32 * iday, int32 * ihour, int32 * imin, double *dsec)
|
||||||
{
|
{
|
||||||
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
|
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
|
||||||
swe_jdet_to_utc(tjd_et, gregflag, iyear, imonth, iday, ihour, imin, dsec);
|
swe_jdet_to_utc(tjd_et, gregflag, iyear, imonth, iday, ihour, imin, dsec);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*********************************************************
|
/*********************************************************
|
||||||
$Header: /home/dieter/sweph/RCS/swedate.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/swedate.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
||||||
version 15-feb-89 16:30
|
version 15-feb-89 16:30
|
||||||
@ -58,24 +59,26 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C"
|
||||||
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _SWEDLL_H
|
#ifndef _SWEDLL_H
|
||||||
extern EXP32 int FAR PASCAL_CONV EXP16 swe_date_conversion (
|
extern EXP32 int FAR PASCAL_CONV EXP16 swe_date_conversion(int y, int m, int d, /* year, month, day */
|
||||||
int y , int m , int d , /* year, month, day */
|
|
||||||
double utime, /* universal time in hours (decimal) */
|
double utime, /* universal time in hours (decimal) */
|
||||||
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
||||||
double *tgmt);
|
double *tgmt);
|
||||||
|
|
||||||
extern EXP32 double *FAR PASCAL_CONV EXP16 swe_julday(
|
extern EXP32 double *FAR PASCAL_CONV EXP16 swe_julday(int year, int month,
|
||||||
int year, int month, int day, double hour,
|
int day,
|
||||||
|
double hour,
|
||||||
int gregflag);
|
int gregflag);
|
||||||
|
|
||||||
extern EXP32 void FAR PASCAL_CONV EXP16 swe_revjul (
|
extern EXP32 void FAR PASCAL_CONV EXP16 swe_revjul(double jd,
|
||||||
double jd,
|
|
||||||
int gregflag,
|
int gregflag,
|
||||||
int *jyear, int *jmon, int *jday, double *jut);
|
int *jyear, int *jmon,
|
||||||
|
int *jday,
|
||||||
|
double *jut);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern C */
|
} /* extern C */
|
||||||
|
745
swe/src/swedll.h
745
swe/src/swedll.h
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/* SWISSEPH
|
/* SWISSEPH
|
||||||
* $Header: /home/dieter/sweph/RCS/swedll.h,v 1.75 2009/04/08 07:19:08 dieter Exp $
|
* $Header: /home/dieter/sweph/RCS/swedll.h,v 1.75 2009/04/08 07:19:08 dieter Exp $
|
||||||
*
|
*
|
||||||
@ -5,6 +6,7 @@
|
|||||||
*
|
*
|
||||||
|
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -59,278 +61,359 @@
|
|||||||
for promoting such software, products or services.
|
for promoting such software, products or services.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* $Id: swedll.h,v 1.75 2009/04/08 07:19:08 dieter Exp $ */
|
/* $Id: swedll.h,v 1.75 2009/04/08 07:19:08 dieter Exp $ */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C"
|
||||||
#endif
|
{
|
||||||
|
|
||||||
|
#endif /*
*/
|
||||||
#ifndef _SWEDLL_H
|
#ifndef _SWEDLL_H
|
||||||
#define _SWEDLL_H
|
#define _SWEDLL_H
|
||||||
|
|
||||||
#ifndef _SWEPHEXP_INCLUDED
|
#ifndef _SWEPHEXP_INCLUDED
|
||||||
#include "swephexp.h"
|
#include "swephexp.h"
|
||||||
#endif
|
#endif /*
*/
|
||||||
|
|
||||||
#ifdef USE_DLL16 /* 16bit DLL */
|
#ifdef USE_DLL16 /* 16bit DLL */
|
||||||
#define DllImport extern
|
#define DllImport extern
|
||||||
#else
|
#else /*
*/
|
||||||
# ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define DllImport extern "C" __declspec( dllimport )
|
#define DllImport extern "C" __declspec( dllimport )
|
||||||
# else
|
#else /*
*/
|
||||||
#define DllImport __declspec( dllimport )
|
#define DllImport __declspec( dllimport )
|
||||||
# endif
|
#endif /*
*/
|
||||||
#endif
|
#endif /*
*/
|
||||||
|
DllImport int32 FAR PASCAL swe_heliacal_ut(double JDNDaysUTStart,
|
||||||
|
double *geopos, double *datm,
|
||||||
|
double *dobs,
|
||||||
|
char *ObjectName,
|
||||||
|
int32 TypeEvent, int32 iflag,
|
||||||
|
double *dret, char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_heliacal_pheno_ut(double JDNDaysUT,
|
||||||
|
double *geopos,
|
||||||
|
double *datm,
|
||||||
|
double *dobs,
|
||||||
|
char *ObjectName,
|
||||||
|
int32 TypeEvent,
|
||||||
|
int32 helflag,
|
||||||
|
double *darr,
|
||||||
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_vis_limit_mag(double tjdut,
|
||||||
|
double *geopos,
|
||||||
|
double *datm, double *dobs,
|
||||||
|
char *ObjectName,
|
||||||
|
int32 helflag,
|
||||||
|
double *dret, char *serr);
|
||||||
|
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_heliacal_ut(double JDNDaysUTStart, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
|
|
||||||
DllImport int32 FAR PASCAL swe_heliacal_pheno_ut(double JDNDaysUT, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
|
|
||||||
DllImport int32 FAR PASCAL swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
|
|
||||||
/* the following are secret, for Victor Reijs' */
|
/* the following are secret, for Victor Reijs' */
|
||||||
DllImport int32 FAR PASCAL swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
DllImport int32 FAR PASCAL swe_heliacal_angle(double tjdut,
|
||||||
DllImport int32 FAR PASCAL swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
double *dgeo,
|
||||||
|
double *datm,
|
||||||
DllImport double FAR PASCAL swe_degnorm(double deg);
|
double *dobs,
|
||||||
|
int32 helflag, double mag,
|
||||||
DllImport char * FAR PASCAL swe_version(char *);
|
double azi_obj,
|
||||||
|
double azi_sun,
|
||||||
DllImport int32 FAR PASCAL swe_calc(
|
double azi_moon,
|
||||||
double tjd, int ipl, int32 iflag,
|
double alt_moon,
|
||||||
double *xx,
|
double *dret, char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_topo_arcus_visionis(double tjdut,
|
||||||
|
double *dgeo,
|
||||||
|
double *datm,
|
||||||
|
double *dobs,
|
||||||
|
int32 helflag,
|
||||||
|
double mag,
|
||||||
|
double azi_obj,
|
||||||
|
double alt_obj,
|
||||||
|
double azi_sun,
|
||||||
|
double azi_moon,
|
||||||
|
double alt_moon,
|
||||||
|
double *dret,
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport double FAR PASCAL swe_degnorm(double deg);
|
||||||
DllImport int32 FAR PASCAL swe_calc_ut(
|
DllImport char *FAR PASCAL swe_version(char *);
|
||||||
double tjd_ut, int32 ipl, int32 iflag,
|
DllImport int32 FAR PASCAL swe_calc(
double tjd, int ipl, int32 iflag,
|
||||||
double *xx,
|
double *xx,
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_calc_ut(
double tjd_ut, int32 ipl,
|
||||||
|
int32 iflag,
double *xx,
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_fixstar(
char *star, double tjd,
|
||||||
DllImport int32 FAR PASCAL swe_fixstar(
|
int32 iflag,
double *xx,
|
||||||
char *star, double tjd, int32 iflag,
|
|
||||||
double *xx,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_fixstar_ut(
char *star, double tjd_ut,
|
||||||
DllImport int32 FAR PASCAL swe_fixstar_ut(
|
int32 iflag,
double *xx,
|
||||||
char *star, double tjd_ut, int32 iflag,
|
|
||||||
double *xx,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_fixstar_mag(
char *star, double *xx,
|
||||||
DllImport int32 FAR PASCAL swe_fixstar_mag(
|
char *serr);
|
||||||
char *star, double *xx, char *serr);
|
DllImport double FAR PASCAL swe_sidtime0(double tjd_ut, double ecl,
|
||||||
|
double nut);
|
||||||
DllImport double FAR PASCAL swe_sidtime0(double tjd_ut, double ecl, double nut);
|
DllImport double FAR PASCAL swe_sidtime(double tjd_ut);
|
||||||
DllImport double FAR PASCAL swe_sidtime(double tjd_ut);
|
DllImport double FAR PASCAL swe_deltat(double tjd);
|
||||||
|
DllImport int FAR PASCAL swe_houses(
double tjd_ut, double geolat,
|
||||||
DllImport double FAR PASCAL swe_deltat(double tjd);
|
double geolon, int hsys,
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_houses(
|
|
||||||
double tjd_ut, double geolat, double geolon, int hsys,
|
|
||||||
double *hcusps, double *ascmc);
|
double *hcusps, double *ascmc);
|
||||||
|
DllImport int FAR PASCAL swe_houses_ex(
double tjd_ut, int32 iflag,
|
||||||
DllImport int FAR PASCAL swe_houses_ex(
|
double geolat, double geolon,
|
||||||
double tjd_ut, int32 iflag, double geolat, double geolon, int hsys,
|
int hsys,
double *hcusps,
|
||||||
double *hcusps, double *ascmc);
|
double *ascmc);
|
||||||
|
DllImport int FAR PASCAL swe_houses_armc(
double armc, double geolat,
|
||||||
DllImport int FAR PASCAL swe_houses_armc(
|
double eps, int hsys,
|
||||||
double armc, double geolat, double eps, int hsys,
|
double *hcusps,
|
||||||
double *hcusps, double *ascmc);
|
double *ascmc);
|
||||||
|
DllImport double FAR PASCAL swe_house_pos(
double armc, double geolon,
|
||||||
DllImport double FAR PASCAL swe_house_pos(
|
double eps, int hsys,
|
||||||
double armc, double geolon, double eps, int hsys, double *xpin, char *serr);
|
double *xpin, char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_gauquelin_sector(
double t_ut, int32 ipl,
|
||||||
DllImport int32 FAR PASCAL swe_gauquelin_sector(
|
char *starname,
|
||||||
double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr);
|
int32 iflag,
|
||||||
|
int32 imeth,
|
||||||
DllImport void FAR PASCAL swe_set_sid_mode(
|
double *geopos,
|
||||||
int32 sid_mode, double t0, double ayan_t0);
|
double atpress,
|
||||||
|
double attemp,
|
||||||
DllImport double FAR PASCAL swe_get_ayanamsa(double tjd_et);
|
double *dgsect,
|
||||||
|
char *serr);
|
||||||
DllImport double FAR PASCAL swe_get_ayanamsa_ut(double tjd_ut);
|
DllImport void FAR PASCAL swe_set_sid_mode(
int32 sid_mode, double t0,
|
||||||
|
double ayan_t0);
|
||||||
DllImport char *FAR PASCAL swe_get_ayanamsa_name(int32 isidmode);
|
DllImport double FAR PASCAL swe_get_ayanamsa(double tjd_et);
|
||||||
|
DllImport double FAR PASCAL swe_get_ayanamsa_ut(double tjd_ut);
|
||||||
DllImport int FAR PASCAL swe_date_conversion(
|
DllImport char *FAR PASCAL swe_get_ayanamsa_name(int32 isidmode);
|
||||||
int y , int m , int d , /* year, month, day */
|
DllImport int FAR PASCAL swe_date_conversion(
int y, int m, int d, /* year, month, day */
|
||||||
double utime, /* universal time in hours (decimal) */
|
double utime, /* universal time in hours (decimal) */
|
||||||
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
||||||
double *tjd);
|
double *tjd);
|
||||||
|
DllImport double FAR PASCAL swe_julday(
int year, int mon, int mday,
|
||||||
DllImport double FAR PASCAL swe_julday(
|
double hour,
int gregflag);
|
||||||
int year, int mon, int mday,
|
DllImport void FAR PASCAL swe_revjul(
double jd, int gregflag,
|
||||||
double hour,
|
|
||||||
int gregflag);
|
|
||||||
|
|
||||||
DllImport void FAR PASCAL swe_revjul(
|
|
||||||
double jd, int gregflag,
|
|
||||||
int *year, int *mon, int *mday,
|
int *year, int *mon, int *mday,
|
||||||
double *hour);
|
double *hour);
|
||||||
|
DllImport void FAR PASCAL swe_utc_time_zone(
int32 iyear, int32 imonth,
|
||||||
DllImport void FAR PASCAL swe_utc_time_zone(
|
int32 iday,
int32 ihour,
|
||||||
int32 iyear, int32 imonth, int32 iday,
|
int32 imin, double dsec,
|
||||||
int32 ihour, int32 imin, double dsec,
|
|
||||||
double d_timezone,
|
double d_timezone,
|
||||||
int32 *iyear_out, int32 *imonth_out, int32 *iday_out,
|
int32 * iyear_out,
|
||||||
int32 *ihour_out, int32 *imin_out, double *dsec_out);
|
int32 * imonth_out,
|
||||||
|
int32 * iday_out,
|
||||||
|
int32 * ihour_out,
|
||||||
|
int32 * imin_out,
|
||||||
|
double *dsec_out);
|
||||||
|
DllImport int32 FAR PASCAL swe_utc_to_jd(
int32 iyear, int32 imonth,
|
||||||
|
int32 iday,
int32 ihour,
|
||||||
|
int32 imin, double dsec,
|
||||||
|
int32 gregflag, double *dret,
|
||||||
|
char *serr);
|
||||||
|
DllImport void FAR PASCAL swe_jdet_to_utc(
double tjd_et,
|
||||||
|
int32 gregflag,
|
||||||
|
int32 * iyear,
|
||||||
|
int32 * imonth, int32 * iday,
|
||||||
|
int32 * ihour, int32 * imin,
|
||||||
|
double *dsec);
|
||||||
|
DllImport void FAR PASCAL swe_jdut1_to_utc(
double tjd_ut,
|
||||||
|
int32 gregflag,
|
||||||
|
int32 * iyear,
|
||||||
|
int32 * imonth, int32 * iday,
|
||||||
|
int32 * ihour, int32 * imin,
|
||||||
|
double *dsec);
|
||||||
|
DllImport int FAR PASCAL swe_time_equ(
double tjd, double *e,
|
||||||
|
char *serr);
|
||||||
|
DllImport double FAR PASCAL swe_get_tid_acc(void);
|
||||||
|
DllImport void FAR PASCAL swe_set_tid_acc(double tidacc);
|
||||||
|
DllImport void FAR PASCAL swe_set_ephe_path(char *path);
|
||||||
|
DllImport void FAR PASCAL swe_set_jpl_file(char *fname);
|
||||||
|
DllImport void FAR PASCAL swe_close(void);
|
||||||
|
DllImport char *FAR PASCAL swe_get_planet_name(int ipl, char *spname);
|
||||||
|
DllImport void FAR PASCAL swe_cotrans(double *xpo, double *xpn,
|
||||||
|
double eps);
|
||||||
|
DllImport void FAR PASCAL swe_cotrans_sp(double *xpo, double *xpn,
|
||||||
|
double eps);
|
||||||
|
DllImport void FAR PASCAL swe_set_topo(double geolon, double geolat,
|
||||||
|
double height);
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_utc_to_jd(
|
|
||||||
int32 iyear, int32 imonth, int32 iday,
|
|
||||||
int32 ihour, int32 imin, double dsec,
|
|
||||||
int32 gregflag, double *dret, char *serr);
|
|
||||||
|
|
||||||
DllImport void FAR PASCAL swe_jdet_to_utc(
|
|
||||||
double tjd_et, int32 gregflag,
|
|
||||||
int32 *iyear, int32 *imonth, int32 *iday,
|
|
||||||
int32 *ihour, int32 *imin, double *dsec);
|
|
||||||
|
|
||||||
DllImport void FAR PASCAL swe_jdut1_to_utc(
|
|
||||||
double tjd_ut, int32 gregflag,
|
|
||||||
int32 *iyear, int32 *imonth, int32 *iday,
|
|
||||||
int32 *ihour, int32 *imin, double *dsec);
|
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_time_equ(
|
|
||||||
double tjd, double *e, char *serr);
|
|
||||||
|
|
||||||
DllImport double FAR PASCAL swe_get_tid_acc(void);
|
|
||||||
DllImport void FAR PASCAL swe_set_tid_acc(double tidacc);
|
|
||||||
DllImport void FAR PASCAL swe_set_ephe_path(char *path);
|
|
||||||
DllImport void FAR PASCAL swe_set_jpl_file(char *fname);
|
|
||||||
DllImport void FAR PASCAL swe_close(void);
|
|
||||||
DllImport char *FAR PASCAL swe_get_planet_name(int ipl, char *spname);
|
|
||||||
DllImport void FAR PASCAL swe_cotrans(double *xpo, double *xpn, double eps);
|
|
||||||
DllImport void FAR PASCAL swe_cotrans_sp(double *xpo, double *xpn, double eps);
|
|
||||||
|
|
||||||
DllImport void FAR PASCAL swe_set_topo(double geolon, double geolat, double height);
|
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* from swecl.c
|
* from swecl.c
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
|
|
||||||
/* computes geographic location and attributes of solar
|
/* computes geographic location and attributes of solar
|
||||||
* eclipse at a given tjd */
|
* eclipse at a given tjd */
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_where(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
DllImport int32 FAR PASCAL swe_sol_eclipse_where(double tjd, int32 ifl,
|
||||||
|
double *geopos,
|
||||||
DllImport int32 FAR PASCAL swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
|
double *attr,
|
||||||
|
char *serr);
|
||||||
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
DllImport int32 FAR PASCAL swe_lun_occult_where(double tjd, int32 ipl,
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_how(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
char *starname,
|
||||||
|
|
||||||
/* finds time of next local eclipse */
|
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
|
||||||
|
|
||||||
/* finds time of next eclipse globally */
|
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
|
||||||
|
|
||||||
/* finds time of next occultation globally */
|
|
||||||
DllImport int32 FAR PASCAL 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 */
|
|
||||||
DllImport int32 FAR PASCAL swe_lun_eclipse_how(
|
|
||||||
double tjd_ut,
|
|
||||||
int32 ifl,
|
int32 ifl,
|
||||||
double *geopos,
|
double *geopos,
|
||||||
double *attr,
|
double *attr,
|
||||||
char *serr);
|
char *serr);
|
||||||
DllImport int32 FAR PASCAL swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
|
||||||
|
|
||||||
|
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
||||||
|
DllImport int32 FAR PASCAL swe_sol_eclipse_how(double tjd, int32 ifl,
|
||||||
|
double *geopos,
|
||||||
|
double *attr,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
|
/* finds time of next local eclipse */
|
||||||
|
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc(double tjd_start,
|
||||||
|
int32 ifl,
|
||||||
|
double *geopos,
|
||||||
|
double *tret,
|
||||||
|
double *attr,
|
||||||
|
int32 backward,
|
||||||
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_lun_occult_when_loc(double tjd_start,
|
||||||
|
int32 ipl,
|
||||||
|
char *starname,
|
||||||
|
int32 ifl,
|
||||||
|
double *geopos,
|
||||||
|
double *tret,
|
||||||
|
double *attr,
|
||||||
|
int32 backward,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
|
/* finds time of next eclipse globally */
|
||||||
|
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob(double tjd_start,
|
||||||
|
int32 ifl,
|
||||||
|
int32 ifltype,
|
||||||
|
double *tret,
|
||||||
|
int32 backward,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
|
/* finds time of next occultation globally */
|
||||||
|
DllImport int32 FAR PASCAL 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 */
|
||||||
|
DllImport int32 FAR PASCAL swe_lun_eclipse_how(
double tjd_ut,
|
||||||
|
int32 ifl,
|
||||||
|
double *geopos,
|
||||||
|
double *attr,
|
||||||
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_lun_eclipse_when(double tjd_start,
|
||||||
|
int32 ifl,
|
||||||
|
int32 ifltype,
|
||||||
|
double *tret,
|
||||||
|
int32 backward,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
/* planetary phenomena */
|
/* planetary phenomena */
|
||||||
DllImport int32 FAR PASCAL swe_pheno(double tjd, int32 ipl, int32 iflag,
|
DllImport int32 FAR PASCAL swe_pheno(double tjd, int32 ipl, int32 iflag,
|
||||||
double *attr, char *serr);
|
double *attr, char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_pheno_ut(double tjd_ut, int32 ipl,
|
||||||
DllImport int32 FAR PASCAL swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
int32 iflag, double *attr,
|
||||||
|
char *serr);
|
||||||
DllImport double FAR PASCAL swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag);
|
DllImport double FAR PASCAL swe_refrac(double inalt, double atpress,
|
||||||
DllImport double FAR PASCAL swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret);
|
double attemp, int32 calc_flag);
|
||||||
DllImport void FAR PASCAL swe_set_lapse_rate(double lapse_rate);
|
DllImport double FAR PASCAL swe_refrac_extended(double inalt,
|
||||||
|
double geoalt,
|
||||||
DllImport void FAR PASCAL swe_azalt(
|
double atpress,
|
||||||
double tjd_ut,
|
double attemp,
|
||||||
|
double lapse_rate,
|
||||||
int32 calc_flag,
|
int32 calc_flag,
|
||||||
|
double *dret);
|
||||||
|
DllImport void FAR PASCAL swe_set_lapse_rate(double lapse_rate);
|
||||||
|
DllImport void FAR PASCAL swe_azalt(
double tjd_ut,
int32 calc_flag,
|
||||||
|
double *geopos,
double atpress,
|
||||||
|
double attemp,
double *xin,
|
||||||
|
double *xaz);
|
||||||
|
DllImport void FAR PASCAL swe_azalt_rev(
double tjd_ut,
|
||||||
|
int32 calc_flag,
|
||||||
|
double *geopos,
double *xin,
|
||||||
|
double *xout);
|
||||||
|
DllImport int32 FAR PASCAL swe_rise_trans(
double tjd_ut, int32 ipl,
|
||||||
|
char *starname,
|
||||||
|
int32 epheflag, int32 rsmi,
|
||||||
|
double *geopos,
|
||||||
|
double atpress,
|
||||||
|
double attemp,
double *tret,
|
||||||
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_rise_trans_true_hor(
double tjd_ut,
|
||||||
|
int32 ipl,
|
||||||
|
char *starname,
|
||||||
|
int32 epheflag,
|
||||||
|
int32 rsmi,
|
||||||
double *geopos,
|
double *geopos,
|
||||||
double atpress,
|
double atpress,
|
||||||
double attemp,
|
double attemp,
|
||||||
double *xin,
|
|
||||||
double *xaz);
|
|
||||||
|
|
||||||
DllImport void FAR PASCAL swe_azalt_rev(
|
|
||||||
double tjd_ut,
|
|
||||||
int32 calc_flag,
|
|
||||||
double *geopos,
|
|
||||||
double *xin,
|
|
||||||
double *xout);
|
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_rise_trans(
|
|
||||||
double tjd_ut, int32 ipl, char *starname,
|
|
||||||
int32 epheflag, int32 rsmi,
|
|
||||||
double *geopos,
|
|
||||||
double atpress, double attemp,
|
|
||||||
double *tret,
|
|
||||||
char *serr);
|
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL 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 horhgt,
|
||||||
double *tret,
|
double *tret,
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_nod_aps(double tjd_et, int32 ipl,
|
||||||
DllImport int32 FAR PASCAL swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
|
int32 iflag,
int32 method,
|
||||||
int32 method,
|
double *xnasc, double *xndsc,
|
||||||
|
double *xperi, double *xaphe,
|
||||||
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_nod_aps_ut(double tjd_ut, int32 ipl,
|
||||||
|
int32 iflag,
int32 method,
|
||||||
double *xnasc, double *xndsc,
|
double *xnasc, double *xndsc,
|
||||||
double *xperi, double *xaphe,
|
double *xperi, double *xaphe,
|
||||||
char *serr);
|
char *serr);
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
|
||||||
int32 method,
|
|
||||||
double *xnasc, double *xndsc,
|
|
||||||
double *xperi, double *xaphe,
|
|
||||||
char *serr);
|
|
||||||
|
|
||||||
/*DllImport int32 FAR PASCAL HeliacalAngle(double Magn, double Age, int SN, double AziO, double AltM, double AziM, double JDNDaysUT, double AziS, double Lat, double HeightEye, double Temperature, double Pressure, double RH, double VR, double *dangret, char *serr);
|
/*DllImport int32 FAR PASCAL HeliacalAngle(double Magn, double Age, int SN, double AziO, double AltM, double AziM, double JDNDaysUT, double AziS, double Lat, double HeightEye, double Temperature, double Pressure, double RH, double VR, double *dangret, char *serr);
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL HeliacalJDut(double JDNDaysUTStart, double Age, int SN, double Lat, double Longitude, double HeightEye, double Temperature, double Pressure, double RH, double VR, char *ObjectName, int TypeEvent, char *AVkind, double *dret, char *serr);*/
|
DllImport int32 FAR PASCAL HeliacalJDut(double JDNDaysUTStart, double Age, int SN, double Lat, double Longitude, double HeightEye, double Temperature, double Pressure, double RH, double VR, char *ObjectName, int TypeEvent, char *AVkind, double *dret, char *serr);*/
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
* other functions from swephlib.c;
|
* other functions from swephlib.c;
|
||||||
* they are not needed for Swiss Ephemeris,
|
* they are not needed for Swiss Ephemeris,
|
||||||
* but may be useful to former Placalc users.
|
* but may be useful to former Placalc users.
|
||||||
********************************************************/
|
********************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* normalize argument into interval [0..DEG360] */
|
/* normalize argument into interval [0..DEG360] */
|
||||||
DllImport centisec FAR PASCAL swe_csnorm(centisec p);
|
DllImport centisec FAR PASCAL swe_csnorm(centisec p);
|
||||||
|
|
||||||
|
|
||||||
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
||||||
DllImport centisec FAR PASCAL swe_difcsn (centisec p1, centisec p2);
|
DllImport centisec FAR PASCAL swe_difcsn(centisec p1, centisec p2);
|
||||||
|
DllImport double FAR PASCAL swe_difdegn(double p1, double p2);
|
||||||
|
|
||||||
DllImport double FAR PASCAL swe_difdegn (double p1, double p2);
|
|
||||||
|
|
||||||
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
||||||
DllImport centisec FAR PASCAL swe_difcs2n(centisec p1, centisec p2);
|
DllImport centisec FAR PASCAL swe_difcs2n(centisec p1, centisec p2);
|
||||||
|
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
|
||||||
|
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
|
||||||
|
DllImport double FAR PASCAL swe_difrad2n(double p1, double p2);
|
||||||
|
DllImport double FAR PASCAL swe_rad_midp(double x1, double x0);
|
||||||
|
DllImport double FAR PASCAL swe_deg_midp(double x1, double x0);
|
||||||
|
|
||||||
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
|
|
||||||
|
|
||||||
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
|
|
||||||
DllImport double FAR PASCAL swe_difrad2n(double p1, double p2);
|
|
||||||
DllImport double FAR PASCAL swe_rad_midp(double x1, double x0);
|
|
||||||
DllImport double FAR PASCAL swe_deg_midp(double x1, double x0);
|
|
||||||
|
|
||||||
/* round second, but at 29.5959 always down */
|
/* round second, but at 29.5959 always down */
|
||||||
DllImport centisec FAR PASCAL swe_csroundsec(centisec x);
|
DllImport centisec FAR PASCAL swe_csroundsec(centisec x);
|
||||||
|
|
||||||
|
|
||||||
/* double to int32 with rounding, no overflow check */
|
/* double to int32 with rounding, no overflow check */
|
||||||
DllImport int32 FAR PASCAL swe_d2l(double x);
|
DllImport int32 FAR PASCAL swe_d2l(double x);
|
||||||
|
DllImport void FAR PASCAL swe_split_deg(double ddeg, int32 roundflag,
|
||||||
|
int32 * ideg, int32 * imin,
|
||||||
|
int32 * isec, double *dsecfr,
|
||||||
|
int32 * isgn);
|
||||||
|
|
||||||
DllImport void FAR PASCAL swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
|
||||||
|
|
||||||
/* monday = 0, ... sunday = 6 */
|
/* monday = 0, ... sunday = 6 */
|
||||||
DllImport int FAR PASCAL swe_day_of_week(double jd);
|
DllImport int FAR PASCAL swe_day_of_week(double jd);
|
||||||
|
DllImport char *FAR PASCAL swe_cs2timestr(CSEC t, int sep,
|
||||||
DllImport char *FAR PASCAL swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
AS_BOOL suppressZero,
|
||||||
|
char *a);
|
||||||
DllImport char *FAR PASCAL swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
|
DllImport char *FAR PASCAL swe_cs2lonlatstr(CSEC t, char pchar,
|
||||||
|
char mchar, char *s);
|
||||||
DllImport char *FAR PASCAL swe_cs2degstr(CSEC t, char *a);
|
DllImport char *FAR PASCAL swe_cs2degstr(CSEC t, char *a);
|
||||||
|
|
||||||
|
|
||||||
/* additional functions for antiquated GFA basic DLL interface.
|
/* additional functions for antiquated GFA basic DLL interface.
|
||||||
@ -338,188 +421,198 @@ DllImport char *FAR PASCAL swe_cs2degstr(CSEC t, char *a);
|
|||||||
* char -> char *
|
* char -> char *
|
||||||
* void -> int
|
* void -> int
|
||||||
*/
|
*/
|
||||||
|
DllImport int32 FAR PASCAL swe_calc_d(
double *tjd, int ipl,
|
||||||
DllImport int32 FAR PASCAL swe_calc_d(
|
int32 iflag,
double *x,
|
||||||
double *tjd, int ipl, int32 iflag,
|
|
||||||
double *x,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_calc_ut_d(
double *tjd, int16 ipl,
|
||||||
DllImport int32 FAR PASCAL swe_calc_ut_d(
|
int32 iflag,
double *x,
|
||||||
double *tjd, int16 ipl, int32 iflag,
|
|
||||||
double *x,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_fixstar_d(
char *star, double *tjd,
|
||||||
DllImport int32 FAR PASCAL swe_fixstar_d(
|
int32 iflag,
double *x,
|
||||||
char *star, double *tjd, int32 iflag,
|
|
||||||
double *x,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_fixstar_ut_d(
char *star, double *tjd,
|
||||||
DllImport int32 FAR PASCAL swe_fixstar_ut_d(
|
int32 iflag,
double *x,
|
||||||
char *star, double *tjd, int32 iflag,
|
|
||||||
double *x,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int FAR PASCAL swe_close_d(int ivoid);
|
||||||
DllImport int FAR PASCAL swe_close_d(int ivoid);
|
DllImport int FAR PASCAL swe_set_ephe_path_d(char *path);
|
||||||
|
DllImport int FAR PASCAL swe_set_jpl_file_d(char *fname);
|
||||||
DllImport int FAR PASCAL swe_set_ephe_path_d(char *path);
|
DllImport char *FAR PASCAL swe_get_planet_name_d(int ipl, char *spname);
|
||||||
|
DllImport int FAR PASCAL swe_deltat_d(double *tjd, double *deltat);
|
||||||
DllImport int FAR PASCAL swe_set_jpl_file_d(char *fname);
|
DllImport int FAR PASCAL swe_sidtime0_d(double *tjd_ut, double *eps,
|
||||||
|
double *nut, double *sidt);
|
||||||
DllImport char *FAR PASCAL swe_get_planet_name_d(int ipl, char *spname);
|
DllImport int FAR PASCAL swe_sidtime_d(double *tjd_ut, double *sidt);
|
||||||
|
DllImport int FAR PASCAL swe_set_sid_mode_d(
int32 sid_mode, double *t0,
|
||||||
DllImport int FAR PASCAL swe_deltat_d(double *tjd, double *deltat);
|
double *ayan_t0);
|
||||||
|
DllImport int FAR PASCAL swe_get_ayanamsa_d(double *tjd_et,
|
||||||
DllImport int FAR PASCAL swe_sidtime0_d(double *tjd_ut, double *eps,
|
double *ayan);
|
||||||
double *nut, double *sidt);
|
DllImport int FAR PASCAL swe_get_ayanamsa_ut_d(double *tjd_et,
|
||||||
DllImport int FAR PASCAL swe_sidtime_d(double *tjd_ut, double *sidt);
|
double *ayan);
|
||||||
|
DllImport int FAR PASCAL swe_cotrans_d(double *xpo, double *xpn,
|
||||||
DllImport int FAR PASCAL swe_set_sid_mode_d(
|
double *eps);
|
||||||
int32 sid_mode, double *t0, double *ayan_t0);
|
DllImport int FAR PASCAL swe_cotrans_sp_d(double *xpo, double *xpn,
|
||||||
|
double *eps);
|
||||||
DllImport int FAR PASCAL swe_get_ayanamsa_d(double *tjd_et, double *ayan);
|
DllImport int FAR PASCAL swe_set_topo_d(double *geolon, double *geolat,
|
||||||
DllImport int FAR PASCAL swe_get_ayanamsa_ut_d(double *tjd_et, double *ayan);
|
double *height);
|
||||||
|
DllImport int FAR PASCAL swe_get_tid_acc_d(double *t_acc);
|
||||||
DllImport int FAR PASCAL swe_cotrans_d(double *xpo, double *xpn, double *eps);
|
DllImport int FAR PASCAL swe_set_tid_acc_d(double *t_acc);
|
||||||
DllImport int FAR PASCAL swe_cotrans_sp_d(double *xpo, double *xpn, double *eps);
|
DllImport int FAR PASCAL swe_degnorm_d(double *x);
|
||||||
|
DllImport int FAR PASCAL swe_date_conversion_d(
int y, int m, int d, /* year, month, day */
|
||||||
DllImport int FAR PASCAL swe_set_topo_d(double *geolon, double *geolat, double *height);
|
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_get_tid_acc_d(double *t_acc);
|
|
||||||
DllImport int FAR PASCAL swe_set_tid_acc_d(double *t_acc);
|
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_degnorm_d(double *x);
|
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_date_conversion_d(
|
|
||||||
int y , int m , int d , /* year, month, day */
|
|
||||||
double *utime, /* universal time in hours (decimal) */
|
double *utime, /* universal time in hours (decimal) */
|
||||||
char *c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
char *c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
||||||
double *tjd);
|
double *tjd);
|
||||||
|
DllImport int FAR PASCAL swe_julday_d(
int year, int month, int day,
|
||||||
DllImport int FAR PASCAL swe_julday_d(
|
double *hour,
int gregflag,
|
||||||
int year, int month, int day, double *hour,
|
double *tjd);
|
||||||
int gregflag, double *tjd);
|
DllImport int FAR PASCAL swe_revjul_d(
double *tjd,
int gregflag,
|
||||||
|
int *jyear, int *jmon, int *jday,
|
||||||
DllImport int FAR PASCAL swe_revjul_d(
|
double *jut);
|
||||||
double *tjd,
|
DllImport int FAR PASCAL swe_houses_d(
double *tjd, double *geolat,
|
||||||
int gregflag,
|
double *geolon, int hsys,
|
||||||
int *jyear, int *jmon, int *jday, double *jut);
|
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_houses_d(
|
|
||||||
double *tjd, double *geolat, double *geolon, int hsys,
|
|
||||||
double *hcusps, double *ascmc);
|
double *hcusps, double *ascmc);
|
||||||
|
DllImport int FAR PASCAL swe_houses_ex_d(
double *tjd_ut, int32 iflag,
|
||||||
|
double *geolat, double *geolon,
|
||||||
|
int hsys,
double *hcusps,
|
||||||
|
double *ascmc);
|
||||||
|
DllImport int FAR PASCAL swe_houses_armc_d(
double *armc,
|
||||||
|
double *geolat, double *eps,
|
||||||
|
int hsys,
double *hcusps,
|
||||||
|
double *ascmc);
|
||||||
|
DllImport int FAR PASCAL swe_house_pos_d(
double *armc, double *geolon,
|
||||||
|
double *eps, int hsys,
|
||||||
|
double *xpin, double *hpos,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_houses_ex_d(
|
|
||||||
double *tjd_ut, int32 iflag, double *geolat, double *geolon, int hsys,
|
|
||||||
double *hcusps, double *ascmc);
|
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_houses_armc_d(
|
|
||||||
double *armc, double *geolat, double *eps, int hsys,
|
|
||||||
double *hcusps, double *ascmc);
|
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_house_pos_d(
|
|
||||||
double *armc, double *geolon, double *eps, int hsys, double *xpin, double *hpos, char *serr);
|
|
||||||
|
|
||||||
/* normalize argument into interval [0..DEG360] */
|
/* normalize argument into interval [0..DEG360] */
|
||||||
DllImport centisec FAR PASCAL swe_csnorm_d(centisec p);
|
DllImport centisec FAR PASCAL swe_csnorm_d(centisec p);
|
||||||
|
|
||||||
|
|
||||||
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
||||||
DllImport centisec FAR PASCAL swe_difcsn_d(centisec p1, centisec p2);
|
DllImport centisec FAR PASCAL swe_difcsn_d(centisec p1, centisec p2);
|
||||||
|
DllImport int FAR PASCAL swe_difdegn_d(double *p1, double *p2,
|
||||||
|
double *diff);
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_difdegn_d(double *p1, double *p2, double *diff);
|
|
||||||
|
|
||||||
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
||||||
DllImport centisec FAR PASCAL swe_difcs2n_d(centisec p1, centisec p2);
|
DllImport centisec FAR PASCAL swe_difcs2n_d(centisec p1, centisec p2);
|
||||||
|
DllImport int FAR PASCAL swe_difdeg2n_d(double *p1, double *p2,
|
||||||
|
double *diff);
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_difdeg2n_d(double *p1, double *p2, double *diff);
|
|
||||||
|
|
||||||
/* round second, but at 29.5959 always down */
|
/* round second, but at 29.5959 always down */
|
||||||
DllImport centisec FAR PASCAL swe_csroundsec_d(centisec x);
|
DllImport centisec FAR PASCAL swe_csroundsec_d(centisec x);
|
||||||
|
|
||||||
|
|
||||||
/* double to int32 with rounding, no overflow check */
|
/* double to int32 with rounding, no overflow check */
|
||||||
DllImport int32 FAR PASCAL swe_d2l_d(double *x);
|
DllImport int32 FAR PASCAL swe_d2l_d(double *x);
|
||||||
|
DllImport int FAR PASCAL swe_split_deg_d(double *ddeg, int32 roundflag,
|
||||||
|
int32 * ideg, int32 * imin,
|
||||||
|
int32 * isec, double *dsecfr,
|
||||||
|
int32 * isgn);
|
||||||
|
|
||||||
DllImport int FAR PASCAL swe_split_deg_d(double *ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
|
||||||
|
|
||||||
/* monday = 0, ... sunday = 6 */
|
/* monday = 0, ... sunday = 6 */
|
||||||
DllImport int FAR PASCAL swe_day_of_week_d(double *jd);
|
DllImport int FAR PASCAL swe_day_of_week_d(double *jd);
|
||||||
|
DllImport char *FAR PASCAL swe_cs2timestr_d(CSEC t, int sep,
|
||||||
|
AS_BOOL suppressZero,
|
||||||
|
char *a);
|
||||||
|
DllImport char *FAR PASCAL swe_cs2lonlatstr_d(CSEC t, char *pchar,
|
||||||
|
char *mchar, char *s);
|
||||||
|
DllImport char *FAR PASCAL swe_cs2degstr_d(CSEC t, char *a);
|
||||||
|
|
||||||
DllImport char *FAR PASCAL swe_cs2timestr_d(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
|
||||||
|
|
||||||
DllImport char *FAR PASCAL swe_cs2lonlatstr_d(CSEC t, char *pchar, char *mchar, char *s);
|
|
||||||
|
|
||||||
DllImport char *FAR PASCAL swe_cs2degstr_d(CSEC t, char *a);
|
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* from swecl.c
|
* from swecl.c
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
|
|
||||||
/* computes geographic location and attributes of solar
|
/* computes geographic location and attributes of solar
|
||||||
* eclipse at a given tjd */
|
* eclipse at a given tjd */
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_where_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr);
|
DllImport int32 FAR PASCAL swe_sol_eclipse_where_d(double *tjd_ut,
|
||||||
|
int32 ifl,
|
||||||
|
double *geopos,
|
||||||
|
double *attr,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_how_d(double *tjd_ut, int32 ifl, double geolon, double geolat, double geohgt, double *attr, char *serr);
|
DllImport int32 FAR PASCAL swe_sol_eclipse_how_d(double *tjd_ut,
|
||||||
|
int32 ifl,
|
||||||
|
double geolon,
|
||||||
|
double geolat,
|
||||||
|
double geohgt,
|
||||||
|
double *attr,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
/* finds time of next local eclipse */
|
/* finds time of next local eclipse */
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc_d(double *tjd_start, int32 ifl, double *geopos, double *tret, double *attr, AS_BOOL backward, char *serr);
|
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc_d(double *tjd_start,
|
||||||
|
int32 ifl,
|
||||||
|
double *geopos,
|
||||||
|
double *tret,
|
||||||
|
double *attr,
|
||||||
|
AS_BOOL backward,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
/* finds time of next eclipse globally */
|
/* finds time of next eclipse globally */
|
||||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob_d(double *tjd_start, int32 ifl, int32 ifltype,
|
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob_d(double
|
||||||
double *tret, AS_BOOL backward, char *serr);
|
*tjd_start,
|
||||||
|
int32 ifl,
|
||||||
|
int32 ifltype,
|
||||||
|
double *tret,
|
||||||
|
AS_BOOL backward,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
|
|
||||||
/* computes attributes of a lunar eclipse for given tjd */
|
/* computes attributes of a lunar eclipse for given tjd */
|
||||||
DllImport int32 FAR PASCAL swe_lun_eclipse_how_d(
|
DllImport int32 FAR PASCAL swe_lun_eclipse_how_d(
double *tjd_ut,
|
||||||
double *tjd_ut,
|
|
||||||
int32 ifl,
|
int32 ifl,
|
||||||
double *attr,
|
double *attr,
|
||||||
char *serr);
|
char *serr);
|
||||||
DllImport int32 FAR PASCAL swe_lun_eclipse_when_d(double *tjd_start, int32 ifl, int32 ifltype,
|
DllImport int32 FAR PASCAL swe_lun_eclipse_when_d(double *tjd_start,
|
||||||
double *tret, AS_BOOL backward, char *serr);
|
int32 ifl,
|
||||||
|
int32 ifltype,
|
||||||
DllImport int32 FAR PASCAL swe_pheno_d(double *tjd, int32 ipl, int32 iflag,
|
double *tret,
|
||||||
double *attr, char *serr);
|
AS_BOOL backward,
|
||||||
|
char *serr);
|
||||||
DllImport int32 FAR PASCAL swe_pheno_ut_d(double *tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
DllImport int32 FAR PASCAL swe_pheno_d(double *tjd, int32 ipl,
|
||||||
|
int32 iflag,
double *attr,
|
||||||
DllImport int FAR PASCAL swe_refrac_d(double *inalt, double *atpress, double *attemp, int32 calc_flag, double *retalt);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_pheno_ut_d(double *tjd_ut, int32 ipl,
|
||||||
DllImport int FAR PASCAL swe_azalt_d(
|
int32 iflag, double *attr,
|
||||||
double *tjd_ut,
|
char *serr);
|
||||||
|
DllImport int FAR PASCAL swe_refrac_d(double *inalt, double *atpress,
|
||||||
|
double *attemp, int32 calc_flag,
|
||||||
|
double *retalt);
|
||||||
|
DllImport int FAR PASCAL swe_azalt_d(
double *tjd_ut,
int32 calc_flag,
|
||||||
|
double *geopos,
double *atpress,
|
||||||
|
double *attemp,
double *xin,
|
||||||
|
double *xaz);
|
||||||
|
DllImport int FAR PASCAL swe_azalt_rev_d(
double *tjd_ut,
|
||||||
int32 calc_flag,
|
int32 calc_flag,
|
||||||
|
double *geopos,
double *xin,
|
||||||
|
double *xout);
|
||||||
|
DllImport int32 FAR PASCAL swe_rise_trans_d(
double *tjd_ut, int32 ipl,
|
||||||
|
char *starname,
|
||||||
|
int32 epheflag, int32 rsmi,
|
||||||
double *geopos,
|
double *geopos,
|
||||||
double *atpress,
|
double *atpress,
|
||||||
double *attemp,
|
double *attemp,
|
||||||
double *xin,
|
double *tret,
char *serr);
|
||||||
double *xaz);
|
DllImport int32 FAR PASCAL swe_nod_aps_d(double *tjd_et, int32 ipl,
|
||||||
|
int32 iflag,
int32 method,
|
||||||
DllImport int FAR PASCAL swe_azalt_rev_d(
|
|
||||||
double *tjd_ut,
|
|
||||||
int32 calc_flag,
|
|
||||||
double *geopos,
|
|
||||||
double *xin,
|
|
||||||
double *xout);
|
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_rise_trans_d(
|
|
||||||
double *tjd_ut, int32 ipl, char *starname,
|
|
||||||
int32 epheflag, int32 rsmi,
|
|
||||||
double *geopos,
|
|
||||||
double *atpress, double *attemp,
|
|
||||||
double *tret,
|
|
||||||
char *serr);
|
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_nod_aps_d(double *tjd_et, int32 ipl, int32 iflag,
|
|
||||||
int32 method,
|
|
||||||
double *xnasc, double *xndsc,
|
|
||||||
double *xperi, double *xaphe,
|
|
||||||
char *serr);
|
|
||||||
|
|
||||||
DllImport int32 FAR PASCAL swe_nod_aps_ut_d(double *tjd_ut, int32 ipl, int32 iflag,
|
|
||||||
int32 method,
|
|
||||||
double *xnasc, double *xndsc,
|
double *xnasc, double *xndsc,
|
||||||
double *xperi, double *xaphe,
|
double *xperi, double *xaphe,
|
||||||
char *serr);
|
char *serr);
|
||||||
|
DllImport int32 FAR PASCAL swe_nod_aps_ut_d(double *tjd_ut, int32 ipl,
|
||||||
|
int32 iflag,
int32 method,
|
||||||
|
double *xnasc,
|
||||||
|
double *xndsc,
|
||||||
|
double *xperi,
|
||||||
|
double *xaphe,
char *serr);
|
||||||
|
|
||||||
#endif /* !_SWEDLL_H */
|
#endif /* !_SWEDLL_H */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern C */
|
} /* extern C */
|
||||||
#endif
|
#endif /*
*/
|
||||||
|
2060
swe/src/swehel.c
2060
swe/src/swehel.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
$Header: /home/dieter/sweph/RCS/swehouse.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/swehouse.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
||||||
module swehouse.h
|
module swehouse.h
|
||||||
@ -59,7 +60,8 @@ house and (simple) aspect calculation
|
|||||||
for promoting such software, products or services.
|
for promoting such software, products or services.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct houses {
|
struct houses
|
||||||
|
{
|
||||||
double cusp[37];
|
double cusp[37];
|
||||||
double ac;
|
double ac;
|
||||||
double mc;
|
double mc;
|
||||||
@ -68,7 +70,7 @@ struct houses {
|
|||||||
double coasc1;
|
double coasc1;
|
||||||
double coasc2;
|
double coasc2;
|
||||||
double polasc;
|
double polasc;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HOUSES struct houses
|
#define HOUSES struct houses
|
||||||
#define VERY_SMALL 1E-10
|
#define VERY_SMALL 1E-10
|
||||||
|
281
swe/src/swejpl.c
281
swe/src/swejpl.c
@ -12,6 +12,7 @@
|
|||||||
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -75,10 +76,12 @@
|
|||||||
#define DEBUG_DO_SHOW FALSE
|
#define DEBUG_DO_SHOW FALSE
|
||||||
|
|
||||||
#ifndef NO_JPL
|
#ifndef NO_JPL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* local globals
|
* local globals
|
||||||
*/
|
*/
|
||||||
struct jpl_save {
|
struct jpl_save
|
||||||
|
{
|
||||||
char *jplfname;
|
char *jplfname;
|
||||||
char *jplfpath;
|
char *jplfpath;
|
||||||
FILE *jplfptr;
|
FILE *jplfptr;
|
||||||
@ -86,7 +89,7 @@ struct jpl_save {
|
|||||||
double eh_cval[400];
|
double eh_cval[400];
|
||||||
double eh_ss[3], eh_au, eh_emrat;
|
double eh_ss[3], eh_au, eh_emrat;
|
||||||
int32 eh_denum, eh_ncon, eh_ipt[39];
|
int32 eh_denum, eh_ncon, eh_ipt[39];
|
||||||
char ch_cnam[6*400];
|
char ch_cnam[6 * 400];
|
||||||
double pv[78];
|
double pv[78];
|
||||||
double pvsun[6];
|
double pvsun[6];
|
||||||
double buf[1500];
|
double buf[1500];
|
||||||
@ -96,9 +99,9 @@ struct jpl_save {
|
|||||||
|
|
||||||
static struct jpl_save *FAR js;
|
static struct jpl_save *FAR js;
|
||||||
|
|
||||||
static int state (double et, int32 *list, int do_bary,
|
static int state(double et, int32 * list, int do_bary, double *pv,
|
||||||
double *pv, double *pvsun, double *nut, char *serr);
|
double *pvsun, double *nut, char *serr);
|
||||||
static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
static int interp(double FAR * buf, double t, double intv, int32 ncfin,
|
||||||
int32 ncmin, int32 nain, int32 ifl, double *pv);
|
int32 ncmin, int32 nain, int32 ifl, double *pv);
|
||||||
static int32 fsizer(char *serr);
|
static int32 fsizer(char *serr);
|
||||||
static void reorder(char *x, int size, int number);
|
static void reorder(char *x, int size, int number);
|
||||||
@ -170,7 +173,8 @@ DE200 DE102 DE403
|
|||||||
* set to a fixed value depending as in previous releases. The caller of
|
* set to a fixed value depending as in previous releases. The caller of
|
||||||
* fsizer() will verify by data comparison whether it computed correctly.
|
* fsizer() will verify by data comparison whether it computed correctly.
|
||||||
*/
|
*/
|
||||||
static int32 fsizer(char *serr)
|
static int32
|
||||||
|
fsizer(char *serr)
|
||||||
{
|
{
|
||||||
/* Local variables */
|
/* Local variables */
|
||||||
int32 ncon;
|
int32 ncon;
|
||||||
@ -179,21 +183,23 @@ static int32 fsizer(char *serr)
|
|||||||
double au, ss[3];
|
double au, ss[3];
|
||||||
int i, kmx, khi, nd;
|
int i, kmx, khi, nd;
|
||||||
int32 ksize, lpt[3];
|
int32 ksize, lpt[3];
|
||||||
char ttl[6*14*3];
|
char ttl[6 * 14 * 3];
|
||||||
if ((js->jplfptr = swi_fopen(SEI_FILE_PLANET, js->jplfname, js->jplfpath, serr)) == NULL) {
|
if ((js->jplfptr =
|
||||||
|
swi_fopen(SEI_FILE_PLANET, js->jplfname, js->jplfpath,
|
||||||
|
serr)) == NULL) {
|
||||||
return NOT_AVAILABLE;
|
return NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
/* ttl = ephemeris title, e.g.
|
/* ttl = ephemeris title, e.g.
|
||||||
* "JPL Planetary Ephemeris DE404/LE404
|
* "JPL Planetary Ephemeris DE404/LE404
|
||||||
* Start Epoch: JED= 625296.5-3001 DEC 21 00:00:00
|
* Start Epoch: JED= 625296.5-3001 DEC 21 00:00:00
|
||||||
* Final Epoch: JED= 2817168.5 3001 JAN 17 00:00:00c */
|
* Final Epoch: JED= 2817168.5 3001 JAN 17 00:00:00c */
|
||||||
fread((void *) &ttl[0], 1, 252, js->jplfptr);
|
fread((void *)&ttl[0], 1, 252, js->jplfptr);
|
||||||
/* cnam = names of constants */
|
/* cnam = names of constants */
|
||||||
fread((void *) js->ch_cnam, 1, 6*400, js->jplfptr);
|
fread((void *)js->ch_cnam, 1, 6 * 400, js->jplfptr);
|
||||||
/* ss[0] = start epoch of ephemeris
|
/* ss[0] = start epoch of ephemeris
|
||||||
* ss[1] = end epoch
|
* ss[1] = end epoch
|
||||||
* ss[2] = segment size in days */
|
* ss[2] = segment size in days */
|
||||||
fread((void *) &ss[0], sizeof(double), 3, js->jplfptr);
|
fread((void *)&ss[0], sizeof(double), 3, js->jplfptr);
|
||||||
/* reorder ? */
|
/* reorder ? */
|
||||||
if (ss[2] < 1 || ss[2] > 200)
|
if (ss[2] < 1 || ss[2] > 200)
|
||||||
js->do_reorder = TRUE;
|
js->do_reorder = TRUE;
|
||||||
@ -202,40 +208,42 @@ static int32 fsizer(char *serr)
|
|||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
js->eh_ss[i] = ss[i];
|
js->eh_ss[i] = ss[i];
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_ss[0], sizeof(double), 3);
|
reorder((char *)&js->eh_ss[0], sizeof(double), 3);
|
||||||
/* plausibility test of these constants. Start and end date must be
|
/* plausibility test of these constants. Start and end date must be
|
||||||
* between -20000 and +20000, segment size >= 1 and <= 200 */
|
* between -20000 and +20000, segment size >= 1 and <= 200 */
|
||||||
if (js->eh_ss[0] < -5583942 || js->eh_ss[1] > 9025909 || js->eh_ss[2] < 1 || js->eh_ss[2] > 200) {
|
if (js->eh_ss[0] < -5583942 || js->eh_ss[1] > 9025909 || js->eh_ss[2] < 1
|
||||||
|
|| js->eh_ss[2] > 200) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "alleged ephemeris file (%s) has invalid format.", js->jplfname);
|
sprintf(serr, "alleged ephemeris file (%s) has invalid format.",
|
||||||
return(NOT_AVAILABLE);
|
js->jplfname);
|
||||||
|
return (NOT_AVAILABLE);
|
||||||
}
|
}
|
||||||
/* ncon = number of constants */
|
/* ncon = number of constants */
|
||||||
fread((void *) &ncon, sizeof(int32), 1, js->jplfptr);
|
fread((void *)&ncon, sizeof(int32), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &ncon, sizeof(int32), 1);
|
reorder((char *)&ncon, sizeof(int32), 1);
|
||||||
/* au = astronomical unit */
|
/* au = astronomical unit */
|
||||||
fread((void *) &au, sizeof(double), 1, js->jplfptr);
|
fread((void *)&au, sizeof(double), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &au, sizeof(double), 1);
|
reorder((char *)&au, sizeof(double), 1);
|
||||||
/* emrat = earth moon mass ratio */
|
/* emrat = earth moon mass ratio */
|
||||||
fread((void *) &emrat, sizeof(double), 1, js->jplfptr);
|
fread((void *)&emrat, sizeof(double), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &emrat, sizeof(double), 1);
|
reorder((char *)&emrat, sizeof(double), 1);
|
||||||
/* ipt[i+0]: coefficients of planet i start at buf[ipt[i+0]-1]
|
/* ipt[i+0]: coefficients of planet i start at buf[ipt[i+0]-1]
|
||||||
* ipt[i+1]: number of coefficients (interpolation order - 1)
|
* ipt[i+1]: number of coefficients (interpolation order - 1)
|
||||||
* ipt[i+2]: number of intervals in segment */
|
* ipt[i+2]: number of intervals in segment */
|
||||||
fread((void *) &js->eh_ipt[0], sizeof(int32), 36, js->jplfptr);
|
fread((void *)&js->eh_ipt[0], sizeof(int32), 36, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_ipt[0], sizeof(int32), 36);
|
reorder((char *)&js->eh_ipt[0], sizeof(int32), 36);
|
||||||
/* numde = number of jpl ephemeris "404" with de404 */
|
/* numde = number of jpl ephemeris "404" with de404 */
|
||||||
fread((void *) &numde, sizeof(int32), 1, js->jplfptr);
|
fread((void *)&numde, sizeof(int32), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &numde, sizeof(int32), 1);
|
reorder((char *)&numde, sizeof(int32), 1);
|
||||||
/* read librations */
|
/* read librations */
|
||||||
fread(&lpt[0], sizeof(int32), 3, js->jplfptr);
|
fread(&lpt[0], sizeof(int32), 3, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &lpt[0], sizeof(int32), 3);
|
reorder((char *)&lpt[0], sizeof(int32), 3);
|
||||||
/* fill librations into eh_ipt[36]..[38] */
|
/* fill librations into eh_ipt[36]..[38] */
|
||||||
for (i = 0; i < 3; ++i)
|
for (i = 0; i < 3; ++i)
|
||||||
js->eh_ipt[i + 36] = lpt[i];
|
js->eh_ipt[i + 36] = lpt[i];
|
||||||
@ -254,7 +262,9 @@ static int32 fsizer(char *serr)
|
|||||||
nd = 2;
|
nd = 2;
|
||||||
else
|
else
|
||||||
nd = 3;
|
nd = 3;
|
||||||
ksize = (js->eh_ipt[khi * 3 - 3] + nd * js->eh_ipt[khi * 3 - 2] * js->eh_ipt[khi * 3 - 1] - 1L) * 2L;
|
ksize =
|
||||||
|
(js->eh_ipt[khi * 3 - 3] +
|
||||||
|
nd * js->eh_ipt[khi * 3 - 2] * js->eh_ipt[khi * 3 - 1] - 1L) * 2L;
|
||||||
/*
|
/*
|
||||||
* de102 files give wrong ksize, because they contain 424 empty bytes
|
* de102 files give wrong ksize, because they contain 424 empty bytes
|
||||||
* per record. Fixed by hand!
|
* per record. Fixed by hand!
|
||||||
@ -262,7 +272,7 @@ static int32 fsizer(char *serr)
|
|||||||
if (ksize == 1546)
|
if (ksize == 1546)
|
||||||
ksize = 1652;
|
ksize = 1652;
|
||||||
#if 0 /* we prefer to compute ksize to be comaptible
|
#if 0 /* we prefer to compute ksize to be comaptible
|
||||||
with new DE releases */
|
* with new DE releases */
|
||||||
switch (numde) {
|
switch (numde) {
|
||||||
case 403:
|
case 403:
|
||||||
case 405:
|
case 405:
|
||||||
@ -285,14 +295,16 @@ static int32 fsizer(char *serr)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr,"unknown numde value %d;", numde);
|
sprintf(serr, "unknown numde value %d;", numde);
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (ksize < 1000 || ksize > 5000) {
|
if (ksize < 1000 || ksize > 5000) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "JPL ephemeris file does not provide valid ksize (%d)", ksize);/**/
|
sprintf(serr,
|
||||||
return NOT_AVAILABLE;
|
"JPL ephemeris file does not provide valid ksize (%d)",
|
||||||
|
ksize);
|
||||||
|
/**/ return NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
return ksize;
|
return ksize;
|
||||||
}
|
}
|
||||||
@ -329,7 +341,8 @@ static int32 fsizer(char *serr)
|
|||||||
* The option is available to have the units in km and km/sec.
|
* The option is available to have the units in km and km/sec.
|
||||||
* For this, set do_km=TRUE (default FALSE).
|
* For this, set do_km=TRUE (default FALSE).
|
||||||
*/
|
*/
|
||||||
int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
int
|
||||||
|
swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
||||||
{
|
{
|
||||||
int i, retc;
|
int i, retc;
|
||||||
int32 list[12];
|
int32 list[12];
|
||||||
@ -345,10 +358,11 @@ int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
|||||||
if (ntarg == J_NUT) {
|
if (ntarg == J_NUT) {
|
||||||
if (js->eh_ipt[34] > 0) {
|
if (js->eh_ipt[34] > 0) {
|
||||||
list[10] = 2;
|
list[10] = 2;
|
||||||
return(state(et, list, FALSE, pv, pvsun, rrd, serr));
|
return (state(et, list, FALSE, pv, pvsun, rrd, serr));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr,"No nutations on the JPL ephemeris file;");
|
sprintf(serr, "No nutations on the JPL ephemeris file;");
|
||||||
return (NOT_AVAILABLE);
|
return (NOT_AVAILABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -360,9 +374,10 @@ int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
|||||||
for (i = 0; i < 6; ++i)
|
for (i = 0; i < 6; ++i)
|
||||||
rrd[i] = pv[i + 60];
|
rrd[i] = pv[i + 60];
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr,"No librations on the ephemeris file;");
|
sprintf(serr, "No librations on the ephemeris file;");
|
||||||
return (NOT_AVAILABLE);
|
return (NOT_AVAILABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -387,29 +402,32 @@ int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
|||||||
return (retc);
|
return (retc);
|
||||||
if (ntarg == J_SUN || ncent == J_SUN) {
|
if (ntarg == J_SUN || ncent == J_SUN) {
|
||||||
for (i = 0; i < 6; ++i)
|
for (i = 0; i < 6; ++i)
|
||||||
pv[i + 6*J_SUN] = pvsun[i];
|
pv[i + 6 * J_SUN] = pvsun[i];
|
||||||
}
|
}
|
||||||
if (ntarg == J_SBARY || ncent == J_SBARY) {
|
if (ntarg == J_SBARY || ncent == J_SBARY) {
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
pv[i + 6*J_SBARY] = 0.;
|
pv[i + 6 * J_SBARY] = 0.;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ntarg == J_EMB || ncent == J_EMB) {
|
if (ntarg == J_EMB || ncent == J_EMB) {
|
||||||
for (i = 0; i < 6; ++i)
|
for (i = 0; i < 6; ++i)
|
||||||
pv[i + 6*J_EMB] = pv[i + 6*J_EARTH];
|
pv[i + 6 * J_EMB] = pv[i + 6 * J_EARTH];
|
||||||
}
|
}
|
||||||
if ((ntarg==J_EARTH && ncent==J_MOON) || (ntarg == J_MOON && ncent==J_EARTH)){
|
if ((ntarg == J_EARTH && ncent == J_MOON)
|
||||||
|
|| (ntarg == J_MOON && ncent == J_EARTH)) {
|
||||||
for (i = 0; i < 6; ++i)
|
for (i = 0; i < 6; ++i)
|
||||||
pv[i + 6*J_EARTH] = 0.;
|
pv[i + 6 * J_EARTH] = 0.;
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (list[J_EARTH] == 2) {
|
if (list[J_EARTH] == 2) {
|
||||||
for (i = 0; i < 6; ++i)
|
for (i = 0; i < 6; ++i)
|
||||||
pv[i + 6*J_EARTH] -= pv[i + 6*J_MOON] / (js->eh_emrat + 1.);
|
pv[i + 6 * J_EARTH] -=
|
||||||
|
pv[i + 6 * J_MOON] / (js->eh_emrat + 1.);
|
||||||
}
|
}
|
||||||
if (list[J_MOON] == 2) {
|
if (list[J_MOON] == 2) {
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
pv[i + 6*J_MOON] += pv[i + 6*J_EARTH];
|
pv[i + 6 * J_MOON] += pv[i + 6 * J_EARTH];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,8 +457,9 @@ int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
|||||||
* pv d.p. interpolated quantities requested.
|
* pv d.p. interpolated quantities requested.
|
||||||
* assumed dimension is pv(ncm,fl).
|
* assumed dimension is pv(ncm,fl).
|
||||||
*/
|
*/
|
||||||
static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
static int
|
||||||
int32 ncmin, int32 nain, int32 ifl, double *pv)
|
interp(double FAR * buf, double t, double intv, int32 ncfin, int32 ncmin,
|
||||||
|
int32 nain, int32 ifl, double *pv)
|
||||||
{
|
{
|
||||||
/* Initialized data */
|
/* Initialized data */
|
||||||
static int FAR np, nv;
|
static int FAR np, nv;
|
||||||
@ -451,9 +470,9 @@ static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
|||||||
double FAR *vc = js->vc;
|
double FAR *vc = js->vc;
|
||||||
double FAR *ac = js->ac;
|
double FAR *ac = js->ac;
|
||||||
double FAR *jc = js->jc;
|
double FAR *jc = js->jc;
|
||||||
int ncf = (int) ncfin;
|
int ncf = (int)ncfin;
|
||||||
int ncm = (int) ncmin;
|
int ncm = (int)ncmin;
|
||||||
int na = (int) nain;
|
int na = (int)nain;
|
||||||
/* Local variables */
|
/* Local variables */
|
||||||
double temp;
|
double temp;
|
||||||
int i, j, ni;
|
int i, j, ni;
|
||||||
@ -461,15 +480,15 @@ static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
|||||||
double dt1, bma;
|
double dt1, bma;
|
||||||
double bma2, bma3;
|
double bma2, bma3;
|
||||||
/*
|
/*
|
||||||
| get correct sub-interval number for this set of coefficients and then
|
* | get correct sub-interval number for this set of coefficients and then
|
||||||
| get normalized chebyshev time within that subinterval.
|
* | get normalized chebyshev time within that subinterval.
|
||||||
*/
|
*/
|
||||||
if (t >= 0)
|
if (t >= 0)
|
||||||
dt1 = floor(t);
|
dt1 = floor(t);
|
||||||
else
|
else
|
||||||
dt1 = -floor(-t);
|
dt1 = -floor(-t);
|
||||||
temp = na * t;
|
temp = na * t;
|
||||||
ni = (int) (temp - dt1);
|
ni = (int)(temp - dt1);
|
||||||
/* tc is the normalized chebyshev time (-1 <= tc <= 1) */
|
/* tc is the normalized chebyshev time (-1 <= tc <= 1) */
|
||||||
tc = (fmod(temp, 1.0) + dt1) * 2. - 1.;
|
tc = (fmod(temp, 1.0) + dt1) * 2. - 1.;
|
||||||
/*
|
/*
|
||||||
@ -498,7 +517,7 @@ static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
|||||||
/* interpolate to get position for each component */
|
/* interpolate to get position for each component */
|
||||||
for (i = 0; i < ncm; ++i) {
|
for (i = 0; i < ncm; ++i) {
|
||||||
pv[i] = 0.;
|
pv[i] = 0.;
|
||||||
for (j = ncf-1; j >= 0; --j)
|
for (j = ncf - 1; j >= 0; --j)
|
||||||
pv[i] += pc[j] * buf[j + (i + ni * ncm) * ncf];
|
pv[i] += pc[j] * buf[j + (i + ni * ncm) * ncf];
|
||||||
}
|
}
|
||||||
if (ifl <= 1)
|
if (ifl <= 1)
|
||||||
@ -517,7 +536,7 @@ static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
|||||||
/* interpolate to get velocity for each component */
|
/* interpolate to get velocity for each component */
|
||||||
for (i = 0; i < ncm; ++i) {
|
for (i = 0; i < ncm; ++i) {
|
||||||
pv[i + ncm] = 0.;
|
pv[i + ncm] = 0.;
|
||||||
for (j = ncf-1; j >= 1; --j)
|
for (j = ncf - 1; j >= 1; --j)
|
||||||
pv[i + ncm] += vc[j] * buf[j + (i + ni * ncm) * ncf];
|
pv[i + ncm] += vc[j] * buf[j + (i + ni * ncm) * ncf];
|
||||||
pv[i + ncm] *= bma;
|
pv[i + ncm] *= bma;
|
||||||
}
|
}
|
||||||
@ -535,7 +554,7 @@ static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
|||||||
/* get acceleration for each component */
|
/* get acceleration for each component */
|
||||||
for (i = 0; i < ncm; ++i) {
|
for (i = 0; i < ncm; ++i) {
|
||||||
pv[i + ncm * 2] = 0.;
|
pv[i + ncm * 2] = 0.;
|
||||||
for (j = ncf-1; j >= 2; --j)
|
for (j = ncf - 1; j >= 2; --j)
|
||||||
pv[i + ncm * 2] += ac[j] * buf[j + (i + ni * ncm) * ncf];
|
pv[i + ncm * 2] += ac[j] * buf[j + (i + ni * ncm) * ncf];
|
||||||
pv[i + ncm * 2] *= bma2;
|
pv[i + ncm * 2] *= bma2;
|
||||||
}
|
}
|
||||||
@ -553,7 +572,7 @@ static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
|||||||
/* get jerk for each component */
|
/* get jerk for each component */
|
||||||
for (i = 0; i < ncm; ++i) {
|
for (i = 0; i < ncm; ++i) {
|
||||||
pv[i + ncm * 3] = 0.;
|
pv[i + ncm * 3] = 0.;
|
||||||
for (j = ncf-1; j >= 3; --j)
|
for (j = ncf - 1; j >= 3; --j)
|
||||||
pv[i + ncm * 3] += jc[j] * buf[j + (i + ni * ncm) * ncf];
|
pv[i + ncm * 3] += jc[j] * buf[j + (i + ni * ncm) * ncf];
|
||||||
pv[i + ncm * 3] *= bma3;
|
pv[i + ncm * 3] *= bma3;
|
||||||
}
|
}
|
||||||
@ -619,8 +638,9 @@ static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
|||||||
| default value = FALSE (km determines time unit
|
| default value = FALSE (km determines time unit
|
||||||
| for nutations and librations. angle unit is always radians.)
|
| for nutations and librations. angle unit is always radians.)
|
||||||
*/
|
*/
|
||||||
static int state(double et, int32 *list, int do_bary,
|
static int
|
||||||
double *pv, double *pvsun, double *nut, char *serr)
|
state(double et, int32 * list, int do_bary, double *pv, double *pvsun,
|
||||||
|
double *nut, char *serr)
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
int32 flen, nseg, nb;
|
int32 flen, nseg, nb;
|
||||||
@ -644,63 +664,66 @@ static int state(double et, int32 *list, int do_bary,
|
|||||||
* "JPL Planetary Ephemeris DE404/LE404
|
* "JPL Planetary Ephemeris DE404/LE404
|
||||||
* Start Epoch: JED= 625296.5-3001 DEC 21 00:00:00
|
* Start Epoch: JED= 625296.5-3001 DEC 21 00:00:00
|
||||||
* Final Epoch: JED= 2817168.5 3001 JAN 17 00:00:00c */
|
* Final Epoch: JED= 2817168.5 3001 JAN 17 00:00:00c */
|
||||||
fread((void *) ch_ttl, 1, 252, js->jplfptr);
|
fread((void *)ch_ttl, 1, 252, js->jplfptr);
|
||||||
/* cnam = names of constants */
|
/* cnam = names of constants */
|
||||||
fread((void *) js->ch_cnam, 1, 2400, js->jplfptr);
|
fread((void *)js->ch_cnam, 1, 2400, js->jplfptr);
|
||||||
/* ss[0] = start epoch of ephemeris
|
/* ss[0] = start epoch of ephemeris
|
||||||
* ss[1] = end epoch
|
* ss[1] = end epoch
|
||||||
* ss[2] = segment size in days */
|
* ss[2] = segment size in days */
|
||||||
fread((void *) &js->eh_ss[0], sizeof(double), 3, js->jplfptr);
|
fread((void *)&js->eh_ss[0], sizeof(double), 3, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_ss[0], sizeof(double), 3);
|
reorder((char *)&js->eh_ss[0], sizeof(double), 3);
|
||||||
/* ncon = number of constants */
|
/* ncon = number of constants */
|
||||||
fread((void *) &js->eh_ncon, sizeof(int32), 1, js->jplfptr);
|
fread((void *)&js->eh_ncon, sizeof(int32), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_ncon, sizeof(int32), 1);
|
reorder((char *)&js->eh_ncon, sizeof(int32), 1);
|
||||||
/* au = astronomical unit */
|
/* au = astronomical unit */
|
||||||
fread((void *) &js->eh_au, sizeof(double), 1, js->jplfptr);
|
fread((void *)&js->eh_au, sizeof(double), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_au, sizeof(double), 1);
|
reorder((char *)&js->eh_au, sizeof(double), 1);
|
||||||
/* emrat = earth moon mass ratio */
|
/* emrat = earth moon mass ratio */
|
||||||
fread((void *) &js->eh_emrat, sizeof(double), 1, js->jplfptr);
|
fread((void *)&js->eh_emrat, sizeof(double), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_emrat, sizeof(double), 1);
|
reorder((char *)&js->eh_emrat, sizeof(double), 1);
|
||||||
/* ipt[i+0]: coefficients of planet i start at buf[ipt[i+0]-1]
|
/* ipt[i+0]: coefficients of planet i start at buf[ipt[i+0]-1]
|
||||||
* ipt[i+1]: number of coefficients (interpolation order - 1)
|
* ipt[i+1]: number of coefficients (interpolation order - 1)
|
||||||
* ipt[i+2]: number of intervals in segment */
|
* ipt[i+2]: number of intervals in segment */
|
||||||
fread((void *) &ipt[0], sizeof(int32), 36, js->jplfptr);
|
fread((void *)&ipt[0], sizeof(int32), 36, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &ipt[0], sizeof(int32), 36);
|
reorder((char *)&ipt[0], sizeof(int32), 36);
|
||||||
/* numde = number of jpl ephemeris "404" with de404 */
|
/* numde = number of jpl ephemeris "404" with de404 */
|
||||||
fread((void *) &js->eh_denum, sizeof(int32), 1, js->jplfptr);
|
fread((void *)&js->eh_denum, sizeof(int32), 1, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_denum, sizeof(int32), 1);
|
reorder((char *)&js->eh_denum, sizeof(int32), 1);
|
||||||
fread((void *) &lpt[0], sizeof(int32), 3, js->jplfptr);
|
fread((void *)&lpt[0], sizeof(int32), 3, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &lpt[0], sizeof(int32), 3);
|
reorder((char *)&lpt[0], sizeof(int32), 3);
|
||||||
/* cval[]: other constants in next record */
|
/* cval[]: other constants in next record */
|
||||||
fseek(js->jplfptr, 1L * irecsz, 0);
|
fseek(js->jplfptr, 1L * irecsz, 0);
|
||||||
fread((void *) &js->eh_cval[0], sizeof(double), 400, js->jplfptr);
|
fread((void *)&js->eh_cval[0], sizeof(double), 400, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &js->eh_cval[0], sizeof(double), 400);
|
reorder((char *)&js->eh_cval[0], sizeof(double), 400);
|
||||||
/* new 26-aug-2008: verify correct block size */
|
/* new 26-aug-2008: verify correct block size */
|
||||||
#if 0
|
#if 0
|
||||||
sp = strstr(js->ch_cnam, "EMRAT ");
|
sp = strstr(js->ch_cnam, "EMRAT ");
|
||||||
if (sp == NULL) {
|
if (sp == NULL) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "JPL ephemeris file strange, constant name 'EMRAT' missing");
|
sprintf(serr,
|
||||||
|
"JPL ephemeris file strange, constant name 'EMRAT' missing");
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
i = (sp - js->ch_cnam);
|
i = (sp - js->ch_cnam);
|
||||||
if (i % 6 != 0) {
|
if (i % 6 != 0) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "JPL ephemeris file strange, constant name 'EMRAT' not at multiple of 6");
|
sprintf(serr,
|
||||||
|
"JPL ephemeris file strange, constant name 'EMRAT' not at multiple of 6");
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
i = i / 6; /* position of EMRAT in constant array eh_cval */
|
i = i / 6; /* position of EMRAT in constant array eh_cval */
|
||||||
if (js->eh_cval[i] != js->eh_emrat) {
|
if (js->eh_cval[i] != js->eh_emrat) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "JPL ephemeris file error, record size failed EMRAT check");
|
sprintf(serr,
|
||||||
|
"JPL ephemeris file error, record size failed EMRAT check");
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -714,11 +737,11 @@ static int state(double et, int32 *list, int do_bary,
|
|||||||
/* # of segments in file */
|
/* # of segments in file */
|
||||||
nseg = (int32) ((js->eh_ss[1] - js->eh_ss[0]) / js->eh_ss[2]);
|
nseg = (int32) ((js->eh_ss[1] - js->eh_ss[0]) / js->eh_ss[2]);
|
||||||
/* sum of all cheby coeffs of all planets and segments */
|
/* sum of all cheby coeffs of all planets and segments */
|
||||||
for(i = 0, nb = 0; i < 13; i++) {
|
for (i = 0, nb = 0; i < 13; i++) {
|
||||||
k = 3;
|
k = 3;
|
||||||
if (i == 11)
|
if (i == 11)
|
||||||
k = 2;
|
k = 2;
|
||||||
nb += (ipt[i*3+1] * ipt[i*3+2]) * k * nseg;
|
nb += (ipt[i * 3 + 1] * ipt[i * 3 + 2]) * k * nseg;
|
||||||
}
|
}
|
||||||
/* add start and end epochs of segments */
|
/* add start and end epochs of segments */
|
||||||
nb += 2 * nseg;
|
nb += 2 * nseg;
|
||||||
@ -728,31 +751,36 @@ static int state(double et, int32 *list, int do_bary,
|
|||||||
nb += 2 * ksize * nrecl;
|
nb += 2 * ksize * nrecl;
|
||||||
#if 0
|
#if 0
|
||||||
printf("hallo %d %d\n", nb, flen);
|
printf("hallo %d %d\n", nb, flen);
|
||||||
printf("hallo %d %d\n", nb-flen, ksize);
|
printf("hallo %d %d\n", nb - flen, ksize);
|
||||||
#endif
|
#endif
|
||||||
if (flen != nb
|
if (flen != nb
|
||||||
/* some of our files are one record too long */
|
/* some of our files are one record too long */
|
||||||
&& flen - nb != ksize * nrecl) {
|
&& flen - nb != ksize * nrecl) {
|
||||||
if (serr != NULL) {
|
if (serr != NULL) {
|
||||||
sprintf(serr, "JPL ephemeris file is mutilated; length = %d instead of %d.", flen, nb);
|
sprintf(serr,
|
||||||
|
"JPL ephemeris file is mutilated; length = %d instead of %d.",
|
||||||
|
flen, nb);
|
||||||
if (strlen(serr) + strlen(js->jplfname) < AS_MAXCH - 1)
|
if (strlen(serr) + strlen(js->jplfname) < AS_MAXCH - 1)
|
||||||
sprintf(serr, "JPL ephemeris file %s is mutilated; length = %d instead of %d.", js->jplfname, flen, nb);
|
sprintf(serr,
|
||||||
|
"JPL ephemeris file %s is mutilated; length = %d instead of %d.",
|
||||||
|
js->jplfname, flen, nb);
|
||||||
}
|
}
|
||||||
return(NOT_AVAILABLE);
|
return (NOT_AVAILABLE);
|
||||||
}
|
}
|
||||||
/* check if start and end dates in segments are the same as in
|
/* check if start and end dates in segments are the same as in
|
||||||
* file header */
|
* file header */
|
||||||
fseek(js->jplfptr, 2L * irecsz, 0);
|
fseek(js->jplfptr, 2L * irecsz, 0);
|
||||||
fread((void *) &ts[0], sizeof(double), 2, js->jplfptr);
|
fread((void *)&ts[0], sizeof(double), 2, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &ts[0], sizeof(double), 2);
|
reorder((char *)&ts[0], sizeof(double), 2);
|
||||||
fseek(js->jplfptr, (nseg + 2 - 1) * irecsz, 0);
|
fseek(js->jplfptr, (nseg + 2 - 1) * irecsz, 0);
|
||||||
fread((void *) &ts[2], sizeof(double), 2, js->jplfptr);
|
fread((void *)&ts[2], sizeof(double), 2, js->jplfptr);
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &ts[2], sizeof(double), 2);
|
reorder((char *)&ts[2], sizeof(double), 2);
|
||||||
if (ts[0] != js->eh_ss[0] || ts[3] != js->eh_ss[1]) {
|
if (ts[0] != js->eh_ss[0] || ts[3] != js->eh_ss[1]) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
strcpy(serr, "JPL ephemeris file is corrupt; start/end date check failed.");
|
strcpy(serr,
|
||||||
|
"JPL ephemeris file is corrupt; start/end date check failed.");
|
||||||
return NOT_AVAILABLE;
|
return NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -765,14 +793,16 @@ static int state(double et, int32 *list, int do_bary,
|
|||||||
/* error return for epoch out of range */
|
/* error return for epoch out of range */
|
||||||
if (et < js->eh_ss[0] || et > js->eh_ss[1]) {
|
if (et < js->eh_ss[0] || et > js->eh_ss[1]) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr,"jd %f outside JPL eph. range %.2f .. %.2f;", et, js->eh_ss[0], js->eh_ss[1]);
|
sprintf(serr, "jd %f outside JPL eph. range %.2f .. %.2f;", et,
|
||||||
|
js->eh_ss[0], js->eh_ss[1]);
|
||||||
return BEYOND_EPH_LIMITS;
|
return BEYOND_EPH_LIMITS;
|
||||||
}
|
}
|
||||||
/* calculate record # and relative time in interval */
|
/* calculate record # and relative time in interval */
|
||||||
nr = (int32) ((et_mn - js->eh_ss[0]) / js->eh_ss[2]) + 2;
|
nr = (int32) ((et_mn - js->eh_ss[0]) / js->eh_ss[2]) + 2;
|
||||||
if (et_mn == js->eh_ss[1])
|
if (et_mn == js->eh_ss[1])
|
||||||
--nr; /* end point of ephemeris, use last record */
|
--nr; /* end point of ephemeris, use last record */
|
||||||
t = (et_mn - ((nr - 2) * js->eh_ss[2] + js->eh_ss[0]) + et_fr) / js->eh_ss[2];
|
t = (et_mn - ((nr - 2) * js->eh_ss[2] + js->eh_ss[0]) +
|
||||||
|
et_fr) / js->eh_ss[2];
|
||||||
/* read correct record if not in core */
|
/* read correct record if not in core */
|
||||||
if (nr != nrl) {
|
if (nr != nrl) {
|
||||||
nrl = nr;
|
nrl = nr;
|
||||||
@ -782,36 +812,39 @@ static int state(double et, int32 *list, int do_bary,
|
|||||||
return NOT_AVAILABLE;
|
return NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
for (k = 1; k <= ncoeffs; ++k) {
|
for (k = 1; k <= ncoeffs; ++k) {
|
||||||
if ( fread((void *) &buf[k - 1], sizeof(double), 1, js->jplfptr) != 1) {
|
if (fread((void *)&buf[k - 1], sizeof(double), 1, js->jplfptr) !=
|
||||||
|
1) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "Read error in JPL eph. at %f\n", et);
|
sprintf(serr, "Read error in JPL eph. at %f\n", et);
|
||||||
return NOT_AVAILABLE;
|
return NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
if (js->do_reorder)
|
if (js->do_reorder)
|
||||||
reorder((char *) &buf[k-1], sizeof(double), 1);
|
reorder((char *)&buf[k - 1], sizeof(double), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (js->do_km) {
|
if (js->do_km) {
|
||||||
intv = js->eh_ss[2] * 86400.;
|
intv = js->eh_ss[2] * 86400.;
|
||||||
aufac = 1.;
|
aufac = 1.;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
intv = js->eh_ss[2];
|
intv = js->eh_ss[2];
|
||||||
aufac = 1. / js->eh_au;
|
aufac = 1. / js->eh_au;
|
||||||
}
|
}
|
||||||
/* interpolate ssbary sun */
|
/* interpolate ssbary sun */
|
||||||
interp(&buf[(int) ipt[30] - 1], t, intv, ipt[31], 3L, ipt[32], 2L, pvsun);
|
interp(&buf[(int)ipt[30] - 1], t, intv, ipt[31], 3L, ipt[32], 2L, pvsun);
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
pvsun[i] *= aufac;
|
pvsun[i] *= aufac;
|
||||||
}
|
}
|
||||||
/* check and interpolate whichever bodies are requested */
|
/* check and interpolate whichever bodies are requested */
|
||||||
for (i = 0; i < 10; ++i) {
|
for (i = 0; i < 10; ++i) {
|
||||||
if (list[i] > 0) {
|
if (list[i] > 0) {
|
||||||
interp(&buf[(int) ipt[i * 3] - 1], t, intv, ipt[i * 3 + 1], 3L,
|
interp(&buf[(int)ipt[i * 3] - 1], t, intv, ipt[i * 3 + 1], 3L,
|
||||||
ipt[i * 3 + 2], list[i], &pv[i * 6]);
|
ipt[i * 3 + 2], list[i], &pv[i * 6]);
|
||||||
for (j = 0; j < 6; ++j) {
|
for (j = 0; j < 6; ++j) {
|
||||||
if (i < 9 && ! do_bary) {
|
if (i < 9 && !do_bary) {
|
||||||
pv[j + i * 6] = pv[j + i * 6] * aufac - pvsun[j];
|
pv[j + i * 6] = pv[j + i * 6] * aufac - pvsun[j];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
pv[j + i * 6] *= aufac;
|
pv[j + i * 6] *= aufac;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -819,12 +852,12 @@ static int state(double et, int32 *list, int do_bary,
|
|||||||
}
|
}
|
||||||
/* do nutations if requested (and if on file) */
|
/* do nutations if requested (and if on file) */
|
||||||
if (list[10] > 0 && ipt[34] > 0) {
|
if (list[10] > 0 && ipt[34] > 0) {
|
||||||
interp(&buf[(int) ipt[33] - 1], t, intv, ipt[34], 2L, ipt[35],
|
interp(&buf[(int)ipt[33] - 1], t, intv, ipt[34], 2L, ipt[35],
|
||||||
list[10], nut);
|
list[10], nut);
|
||||||
}
|
}
|
||||||
/* get librations if requested (and if on file) */
|
/* get librations if requested (and if on file) */
|
||||||
if (list[11] > 0 && ipt[37] > 0) {
|
if (list[11] > 0 && ipt[37] > 0) {
|
||||||
interp(&buf[(int) ipt[36] - 1], t, intv, ipt[37], 3L, ipt[38], list[1],
|
interp(&buf[(int)ipt[36] - 1], t, intv, ipt[37], 3L, ipt[38], list[1],
|
||||||
&pv[60]);
|
&pv[60]);
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
@ -834,7 +867,8 @@ static int state(double et, int32 *list, int do_bary,
|
|||||||
* this entry obtains the constants from the ephemeris file
|
* this entry obtains the constants from the ephemeris file
|
||||||
* call state to initialize the ephemeris and read in the constants
|
* call state to initialize the ephemeris and read in the constants
|
||||||
*/
|
*/
|
||||||
static int read_const_jpl(double *ss, char *serr)
|
static int
|
||||||
|
read_const_jpl(double *ss, char *serr)
|
||||||
{
|
{
|
||||||
int i, retc;
|
int i, retc;
|
||||||
retc = state(0.0, NULL, FALSE, NULL, NULL, NULL, serr);
|
retc = state(0.0, NULL, FALSE, NULL, NULL, NULL, serr);
|
||||||
@ -846,22 +880,25 @@ static int read_const_jpl(double *ss, char *serr)
|
|||||||
{
|
{
|
||||||
static char FAR *bname[] = {
|
static char FAR *bname[] = {
|
||||||
"Mercury", "Venus", "EMB", "Mars", "Jupiter", "Saturn",
|
"Mercury", "Venus", "EMB", "Mars", "Jupiter", "Saturn",
|
||||||
"Uranus", "Neptune", "Pluto", "Moon", "SunBary", "Nut", "Libr"};
|
"Uranus", "Neptune", "Pluto", "Moon", "SunBary", "Nut", "Libr"
|
||||||
|
};
|
||||||
int j, k;
|
int j, k;
|
||||||
int32 nb, nc;
|
int32 nb, nc;
|
||||||
printf(" JPL TEST-EPHEMERIS program. Version October 1995.\n");
|
printf(" JPL TEST-EPHEMERIS program. Version October 1995.\n");
|
||||||
for (i = 0; i < 13; i++) {
|
for (i = 0; i < 13; i++) {
|
||||||
j = i * 3;
|
j = i * 3;
|
||||||
k = 3;
|
k = 3;
|
||||||
if (i == 11) k = 2;
|
if (i == 11)
|
||||||
nb = js->eh_ipt[j+1] * js->eh_ipt[j+2] * k;
|
k = 2;
|
||||||
|
nb = js->eh_ipt[j + 1] * js->eh_ipt[j + 2] * k;
|
||||||
nc = (int32) (nb * 36525L / js->eh_ss[2] * 8L);
|
nc = (int32) (nb * 36525L / js->eh_ss[2] * 8L);
|
||||||
printf("%s\t%d\tipt[%d]\t%3ld %2ld %2ld,\t",
|
printf("%s\t%d\tipt[%d]\t%3ld %2ld %2ld,\t", bname[i], i, j,
|
||||||
bname[i], i, j, js->eh_ipt[j], js->eh_ipt[j+1], js->eh_ipt[j+2]);
|
js->eh_ipt[j], js->eh_ipt[j + 1], js->eh_ipt[j + 2]);
|
||||||
printf("%3ld double, bytes per century = %6ld\n", nb, nc);
|
printf("%3ld double, bytes per century = %6ld\n", nb, nc);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
printf("%16.2f %16.2f %16.2f\n", js->eh_ss[0], js->eh_ss[1], js->eh_ss[2]);
|
printf("%16.2f %16.2f %16.2f\n", js->eh_ss[0], js->eh_ss[1],
|
||||||
|
js->eh_ss[2]);
|
||||||
for (i = 0; i < js->eh_ncon; ++i)
|
for (i = 0; i < js->eh_ncon; ++i)
|
||||||
printf("%.6s\t%24.16f\n", js->ch_cnam + i * 6, js->eh_cval[i]);
|
printf("%.6s\t%24.16f\n", js->ch_cnam + i * 6, js->eh_cval[i]);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@ -870,7 +907,8 @@ static int read_const_jpl(double *ss, char *serr)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reorder(char *x, int size, int number)
|
static void
|
||||||
|
reorder(char *x, int size, int number)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char s[8];
|
char s[8];
|
||||||
@ -885,30 +923,31 @@ static void reorder(char *x, int size, int number)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void swi_close_jpl_file(void)
|
void
|
||||||
|
swi_close_jpl_file(void)
|
||||||
{
|
{
|
||||||
if (js != NULL) {
|
if (js != NULL) {
|
||||||
if (js->jplfptr != NULL)
|
if (js->jplfptr != NULL)
|
||||||
fclose(js->jplfptr);
|
fclose(js->jplfptr);
|
||||||
if (js->jplfname != NULL)
|
if (js->jplfname != NULL)
|
||||||
FREE((void *) js->jplfname);
|
FREE((void *)js->jplfname);
|
||||||
if (js->jplfpath != NULL)
|
if (js->jplfpath != NULL)
|
||||||
FREE((void *) js->jplfpath);
|
FREE((void *)js->jplfpath);
|
||||||
FREE((void *) js);
|
FREE((void *)js);
|
||||||
js = NULL;
|
js = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int swi_open_jpl_file(double *ss, char *fname, char *fpath, char *serr)
|
int
|
||||||
|
swi_open_jpl_file(double *ss, char *fname, char *fpath, char *serr)
|
||||||
{
|
{
|
||||||
int retc = OK;
|
int retc = OK;
|
||||||
/* if open, return */
|
/* if open, return */
|
||||||
if (js != NULL && js->jplfptr != NULL)
|
if (js != NULL && js->jplfptr != NULL)
|
||||||
return OK;
|
return OK;
|
||||||
if ((js = (struct jpl_save *) CALLOC(1, sizeof(struct jpl_save))) == NULL
|
if ((js = (struct jpl_save *)CALLOC(1, sizeof(struct jpl_save))) == NULL
|
||||||
|| (js->jplfname = MALLOC(strlen(fname)+1)) == NULL
|
|| (js->jplfname = MALLOC(strlen(fname) + 1)) == NULL
|
||||||
|| (js->jplfpath = MALLOC(strlen(fpath)+1)) == NULL
|
|| (js->jplfpath = MALLOC(strlen(fpath) + 1)) == NULL) {
|
||||||
) {
|
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
strcpy(serr, "error in malloc() with JPL ephemeris.");
|
strcpy(serr, "error in malloc() with JPL ephemeris.");
|
||||||
return ERR;
|
return ERR;
|
||||||
@ -929,9 +968,9 @@ int swi_open_jpl_file(double *ss, char *fname, char *fpath, char *serr)
|
|||||||
return retc;
|
return retc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 swi_get_jpl_denum()
|
int32
|
||||||
|
swi_get_jpl_denum()
|
||||||
{
|
{
|
||||||
return js->eh_denum;
|
return js->eh_denum;
|
||||||
}
|
}
|
||||||
#endif /* NO_JPL */
|
#endif /* NO_JPL */
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
| $Header: /home/dieter/sweph/RCS/swejpl.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
| $Header: /home/dieter/sweph/RCS/swejpl.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
||||||
|
|
|
|
||||||
@ -10,6 +11,7 @@
|
|||||||
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
||||||
|
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -89,7 +91,8 @@
|
|||||||
* ntarg can be all of the above, ncent all except J_NUT and J_LIB.
|
* ntarg can be all of the above, ncent all except J_NUT and J_LIB.
|
||||||
* Librations and Nutations are not affected by ncent.
|
* Librations and Nutations are not affected by ncent.
|
||||||
*/
|
*/
|
||||||
extern int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr);
|
extern int swi_pleph(double et, int ntarg, int ncent, double *rrd,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* read the ephemeris constants. ss[0..2] returns start, end and granule size.
|
* read the ephemeris constants. ss[0..2] returns start, end and granule size.
|
||||||
@ -97,9 +100,9 @@ extern int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr);
|
|||||||
*/
|
*/
|
||||||
extern void swi_close_jpl_file(void);
|
extern void swi_close_jpl_file(void);
|
||||||
|
|
||||||
extern int swi_open_jpl_file(double *ss, char *fname, char *fpath, char *serr);
|
extern int swi_open_jpl_file(double *ss, char *fname, char *fpath,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
extern int32 swi_get_jpl_denum(void);
|
extern int32 swi_get_jpl_denum(void);
|
||||||
|
|
||||||
extern void swi_IERS_FK5(double *xin, double *xout, int dir);
|
extern void swi_IERS_FK5(double *xin, double *xout, int dir);
|
||||||
|
|
||||||
|
2074
swe/src/swemmoon.c
2074
swe/src/swemmoon.c
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/* SWISSEPH
|
/* SWISSEPH
|
||||||
$Header: /home/dieter/sweph/RCS/swemplan.c,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/swemplan.c,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
||||||
Moshier planet routines
|
Moshier planet routines
|
||||||
@ -5,6 +6,7 @@
|
|||||||
modified for SWISSEPH by Dieter Koch
|
modified for SWISSEPH by Dieter Koch
|
||||||
|
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -71,23 +73,24 @@
|
|||||||
|
|
||||||
#define FICT_GEO 1
|
#define FICT_GEO 1
|
||||||
#define KGAUSS_GEO 0.0000298122353216 /* Earth only */
|
#define KGAUSS_GEO 0.0000298122353216 /* Earth only */
|
||||||
|
|
||||||
/* #define KGAUSS_GEO 0.00002999502129737 Earth + Moon */
|
/* #define KGAUSS_GEO 0.00002999502129737 Earth + Moon */
|
||||||
|
|
||||||
static void embofs_mosh(double J, double *xemb);
|
static void embofs_mosh(double J, double *xemb);
|
||||||
static int check_t_terms(double t, char *sinp, double *doutp);
|
static int check_t_terms(double t, char *sinp, double *doutp);
|
||||||
|
|
||||||
static int read_elements_file(int32 ipl, double tjd,
|
static int read_elements_file(int32 ipl, double tjd, double *tjd0,
|
||||||
double *tjd0, double *tequ,
|
double *tequ, double *mano, double *sema,
|
||||||
double *mano, double *sema, double *ecce,
|
double *ecce, double *parg, double *node,
|
||||||
double *parg, double *node, double *incl,
|
double *incl, char *pname, int32 * fict_ifl,
|
||||||
char *pname, int32 *fict_ifl, char *serr);
|
char *serr);
|
||||||
|
|
||||||
static int pnoint2msh[] = {2, 2, 0, 1, 3, 4, 5, 6, 7, 8, };
|
static int pnoint2msh[] = { 2, 2, 0, 1, 3, 4, 5, 6, 7, 8, };
|
||||||
|
|
||||||
|
|
||||||
/* From Simon et al (1994) */
|
/* From Simon et al (1994) */
|
||||||
static double freqs[] =
|
static double freqs[] = {
|
||||||
{
|
|
||||||
/* Arc sec per 10000 Julian years. */
|
/* Arc sec per 10000 Julian years. */
|
||||||
53810162868.8982,
|
53810162868.8982,
|
||||||
21066413643.3548,
|
21066413643.3548,
|
||||||
@ -100,8 +103,8 @@ static double freqs[] =
|
|||||||
52272245.1795
|
52272245.1795
|
||||||
};
|
};
|
||||||
|
|
||||||
static double phases[] =
|
static double phases[] = {
|
||||||
{
|
|
||||||
/* Arc sec. */
|
/* Arc sec. */
|
||||||
252.25090552 * 3600.,
|
252.25090552 * 3600.,
|
||||||
181.97980085 * 3600.,
|
181.97980085 * 3600.,
|
||||||
@ -114,8 +117,7 @@ static double phases[] =
|
|||||||
860492.1546,
|
860492.1546,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct plantbl *planets[] =
|
static struct plantbl *planets[] = {
|
||||||
{
|
|
||||||
&mer404,
|
&mer404,
|
||||||
&ven404,
|
&ven404,
|
||||||
&ear404,
|
&ear404,
|
||||||
@ -130,9 +132,10 @@ static struct plantbl *planets[] =
|
|||||||
static double FAR ss[9][24];
|
static double FAR ss[9][24];
|
||||||
static double FAR cc[9][24];
|
static double FAR cc[9][24];
|
||||||
|
|
||||||
static void sscc (int k, double arg, int n);
|
static void sscc(int k, double arg, int n);
|
||||||
|
|
||||||
int swi_moshplan2 (double J, int iplm, double *pobj)
|
int
|
||||||
|
swi_moshplan2(double J, int iplm, double *pobj)
|
||||||
{
|
{
|
||||||
int i, j, k, m, k1, ip, np, nt;
|
int i, j, k, m, k1, ip, np, nt;
|
||||||
signed char FAR *p;
|
signed char FAR *p;
|
||||||
@ -143,12 +146,10 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
|
|
||||||
T = (J - J2000) / TIMESCALE;
|
T = (J - J2000) / TIMESCALE;
|
||||||
/* Calculate sin( i*MM ), etc. for needed multiple angles. */
|
/* Calculate sin( i*MM ), etc. for needed multiple angles. */
|
||||||
for (i = 0; i < 9; i++)
|
for (i = 0; i < 9; i++) {
|
||||||
{
|
if ((j = plan->max_harmonic[i]) > 0) {
|
||||||
if ((j = plan->max_harmonic[i]) > 0)
|
sr = (mods3600(freqs[i] * T) + phases[i]) * STR;
|
||||||
{
|
sscc(i, sr, j);
|
||||||
sr = (mods3600 (freqs[i] * T) + phases[i]) * STR;
|
|
||||||
sscc (i, sr, j);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,34 +163,29 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
sb = 0.0;
|
sb = 0.0;
|
||||||
sr = 0.0;
|
sr = 0.0;
|
||||||
|
|
||||||
for (;;)
|
for (;;) {
|
||||||
{
|
|
||||||
/* argument of sine and cosine */
|
/* argument of sine and cosine */
|
||||||
/* Number of periodic arguments. */
|
/* Number of periodic arguments. */
|
||||||
np = *p++;
|
np = *p++;
|
||||||
if (np < 0)
|
if (np < 0)
|
||||||
break;
|
break;
|
||||||
if (np == 0)
|
if (np == 0) { /* It is a polynomial term. */
|
||||||
{ /* It is a polynomial term. */
|
|
||||||
nt = *p++;
|
nt = *p++;
|
||||||
/* Longitude polynomial. */
|
/* Longitude polynomial. */
|
||||||
cu = *pl++;
|
cu = *pl++;
|
||||||
for (ip = 0; ip < nt; ip++)
|
for (ip = 0; ip < nt; ip++) {
|
||||||
{
|
|
||||||
cu = cu * T + *pl++;
|
cu = cu * T + *pl++;
|
||||||
}
|
}
|
||||||
sl += mods3600 (cu);
|
sl += mods3600(cu);
|
||||||
/* Latitude polynomial. */
|
/* Latitude polynomial. */
|
||||||
cu = *pb++;
|
cu = *pb++;
|
||||||
for (ip = 0; ip < nt; ip++)
|
for (ip = 0; ip < nt; ip++) {
|
||||||
{
|
|
||||||
cu = cu * T + *pb++;
|
cu = cu * T + *pb++;
|
||||||
}
|
}
|
||||||
sb += cu;
|
sb += cu;
|
||||||
/* Radius polynomial. */
|
/* Radius polynomial. */
|
||||||
cu = *pr++;
|
cu = *pr++;
|
||||||
for (ip = 0; ip < nt; ip++)
|
for (ip = 0; ip < nt; ip++) {
|
||||||
{
|
|
||||||
cu = cu * T + *pr++;
|
cu = cu * T + *pr++;
|
||||||
}
|
}
|
||||||
sr += cu;
|
sr += cu;
|
||||||
@ -198,14 +194,12 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
k1 = 0;
|
k1 = 0;
|
||||||
cv = 0.0;
|
cv = 0.0;
|
||||||
sv = 0.0;
|
sv = 0.0;
|
||||||
for (ip = 0; ip < np; ip++)
|
for (ip = 0; ip < np; ip++) {
|
||||||
{
|
|
||||||
/* What harmonic. */
|
/* What harmonic. */
|
||||||
j = *p++;
|
j = *p++;
|
||||||
/* Which planet. */
|
/* Which planet. */
|
||||||
m = *p++ - 1;
|
m = *p++ - 1;
|
||||||
if (j)
|
if (j) {
|
||||||
{
|
|
||||||
k = j;
|
k = j;
|
||||||
if (j < 0)
|
if (j < 0)
|
||||||
k = -k;
|
k = -k;
|
||||||
@ -214,14 +208,12 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
if (j < 0)
|
if (j < 0)
|
||||||
su = -su;
|
su = -su;
|
||||||
cu = cc[m][k];
|
cu = cc[m][k];
|
||||||
if (k1 == 0)
|
if (k1 == 0) { /* set first angle */
|
||||||
{ /* set first angle */
|
|
||||||
sv = su;
|
sv = su;
|
||||||
cv = cu;
|
cv = cu;
|
||||||
k1 = 1;
|
k1 = 1;
|
||||||
}
|
}
|
||||||
else
|
else { /* combine angles */
|
||||||
{ /* combine angles */
|
|
||||||
t = su * cv + cu * sv;
|
t = su * cv + cu * sv;
|
||||||
cv = cu * cv - su * sv;
|
cv = cu * cv - su * sv;
|
||||||
sv = t;
|
sv = t;
|
||||||
@ -233,8 +225,7 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
/* Longitude. */
|
/* Longitude. */
|
||||||
cu = *pl++;
|
cu = *pl++;
|
||||||
su = *pl++;
|
su = *pl++;
|
||||||
for (ip = 0; ip < nt; ip++)
|
for (ip = 0; ip < nt; ip++) {
|
||||||
{
|
|
||||||
cu = cu * T + *pl++;
|
cu = cu * T + *pl++;
|
||||||
su = su * T + *pl++;
|
su = su * T + *pl++;
|
||||||
}
|
}
|
||||||
@ -242,8 +233,7 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
/* Latitiude. */
|
/* Latitiude. */
|
||||||
cu = *pb++;
|
cu = *pb++;
|
||||||
su = *pb++;
|
su = *pb++;
|
||||||
for (ip = 0; ip < nt; ip++)
|
for (ip = 0; ip < nt; ip++) {
|
||||||
{
|
|
||||||
cu = cu * T + *pb++;
|
cu = cu * T + *pb++;
|
||||||
su = su * T + *pb++;
|
su = su * T + *pb++;
|
||||||
}
|
}
|
||||||
@ -251,8 +241,7 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
/* Radius. */
|
/* Radius. */
|
||||||
cu = *pr++;
|
cu = *pr++;
|
||||||
su = *pr++;
|
su = *pr++;
|
||||||
for (ip = 0; ip < nt; ip++)
|
for (ip = 0; ip < nt; ip++) {
|
||||||
{
|
|
||||||
cu = cu * T + *pr++;
|
cu = cu * T + *pr++;
|
||||||
su = su * T + *pr++;
|
su = su * T + *pr++;
|
||||||
}
|
}
|
||||||
@ -274,7 +263,9 @@ int swi_moshplan2 (double J, int iplm, double *pobj)
|
|||||||
* xe earth's
|
* xe earth's
|
||||||
* serr error string
|
* serr error string
|
||||||
*/
|
*/
|
||||||
int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *xeret, char *serr)
|
int
|
||||||
|
swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret,
|
||||||
|
double *xeret, char *serr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int do_earth = FALSE;
|
int do_earth = FALSE;
|
||||||
@ -290,7 +281,8 @@ int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *x
|
|||||||
if (do_save) {
|
if (do_save) {
|
||||||
xp = pdp->x;
|
xp = pdp->x;
|
||||||
xe = pedp->x;
|
xe = pedp->x;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
xp = xxp;
|
xp = xxp;
|
||||||
xe = xxe;
|
xe = xxe;
|
||||||
}
|
}
|
||||||
@ -304,18 +296,18 @@ int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *x
|
|||||||
if (strlen(serr) + strlen(s) < AS_MAXCH)
|
if (strlen(serr) + strlen(s) < AS_MAXCH)
|
||||||
strcat(serr, s);
|
strcat(serr, s);
|
||||||
}
|
}
|
||||||
return(ERR);
|
return (ERR);
|
||||||
}
|
}
|
||||||
/* earth, for geocentric position */
|
/* earth, for geocentric position */
|
||||||
if (do_earth) {
|
if (do_earth) {
|
||||||
if (tjd == pedp->teval
|
if (tjd == pedp->teval && pedp->iephe == SEFLG_MOSEPH) {
|
||||||
&& pedp->iephe == SEFLG_MOSEPH) {
|
|
||||||
xe = pedp->x;
|
xe = pedp->x;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/* emb */
|
/* emb */
|
||||||
swi_moshplan2(tjd, pnoint2msh[SEI_EMB], xe); /* emb hel. ecl. 2000 polar */
|
swi_moshplan2(tjd, pnoint2msh[SEI_EMB], xe); /* emb hel. ecl. 2000 polar */
|
||||||
swi_polcart(xe, xe); /* to cartesian */
|
swi_polcart(xe, xe); /* to cartesian */
|
||||||
swi_coortrf2(xe, xe, -seps2000, ceps2000);/* and equator 2000 */
|
swi_coortrf2(xe, xe, -seps2000, ceps2000); /* and equator 2000 */
|
||||||
embofs_mosh(tjd, xe); /* emb -> earth */
|
embofs_mosh(tjd, xe); /* emb -> earth */
|
||||||
if (do_save) {
|
if (do_save) {
|
||||||
pedp->teval = tjd;
|
pedp->teval = tjd;
|
||||||
@ -326,12 +318,12 @@ int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *x
|
|||||||
swi_moshplan2(tjd - PLAN_SPEED_INTV, pnoint2msh[SEI_EMB], x2);
|
swi_moshplan2(tjd - PLAN_SPEED_INTV, pnoint2msh[SEI_EMB], x2);
|
||||||
swi_polcart(x2, x2);
|
swi_polcart(x2, x2);
|
||||||
swi_coortrf2(x2, x2, -seps2000, ceps2000);
|
swi_coortrf2(x2, x2, -seps2000, ceps2000);
|
||||||
embofs_mosh(tjd - PLAN_SPEED_INTV, x2);/**/
|
embofs_mosh(tjd - PLAN_SPEED_INTV, x2);
|
||||||
for (i = 0; i <= 2; i++)
|
/**/ for (i = 0; i <= 2; i++)
|
||||||
dx[i] = (xe[i] - x2[i]) / PLAN_SPEED_INTV;
|
dx[i] = (xe[i] - x2[i]) / PLAN_SPEED_INTV;
|
||||||
/* store speed */
|
/* store speed */
|
||||||
for (i = 0; i <= 2; i++) {
|
for (i = 0; i <= 2; i++) {
|
||||||
xe[i+3] = dx[i];
|
xe[i + 3] = dx[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (xeret != NULL)
|
if (xeret != NULL)
|
||||||
@ -341,28 +333,30 @@ int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *x
|
|||||||
/* earth is the planet wanted */
|
/* earth is the planet wanted */
|
||||||
if (ipli == SEI_EARTH) {
|
if (ipli == SEI_EARTH) {
|
||||||
xp = xe;
|
xp = xe;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/* other planet */
|
/* other planet */
|
||||||
/* if planet has already been computed, return */
|
/* if planet has already been computed, return */
|
||||||
if (tjd == pdp->teval && pdp->iephe == SEFLG_MOSEPH) {
|
if (tjd == pdp->teval && pdp->iephe == SEFLG_MOSEPH) {
|
||||||
xp = pdp->x;
|
xp = pdp->x;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
swi_moshplan2(tjd, iplm, xp);
|
swi_moshplan2(tjd, iplm, xp);
|
||||||
swi_polcart(xp, xp);
|
swi_polcart(xp, xp);
|
||||||
swi_coortrf2(xp, xp, -seps2000, ceps2000);
|
swi_coortrf2(xp, xp, -seps2000, ceps2000);
|
||||||
if (do_save) {
|
if (do_save) {
|
||||||
pdp->teval = tjd;/**/
|
pdp->teval = tjd;
|
||||||
pdp->xflgs = -1;
|
/**/ pdp->xflgs = -1;
|
||||||
pdp->iephe = SEFLG_MOSEPH;
|
pdp->iephe = SEFLG_MOSEPH;
|
||||||
}
|
}
|
||||||
/* one more position for speed.
|
/* one more position for speed.
|
||||||
* the following dt gives good speed for light-time correction
|
* the following dt gives good speed for light-time correction
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
for (i = 0; i <= 2; i++)
|
for (i = 0; i <= 2; i++)
|
||||||
dx[i] = xp[i] - pedp->x[i];
|
dx[i] = xp[i] - pedp->x[i];
|
||||||
dt = LIGHTTIME_AUNIT * sqrt(square_sum(dx));
|
dt = LIGHTTIME_AUNIT * sqrt(square_sum(dx));
|
||||||
#endif
|
#endif
|
||||||
dt = PLAN_SPEED_INTV;
|
dt = PLAN_SPEED_INTV;
|
||||||
swi_moshplan2(tjd - dt, iplm, x2);
|
swi_moshplan2(tjd - dt, iplm, x2);
|
||||||
swi_polcart(x2, x2);
|
swi_polcart(x2, x2);
|
||||||
@ -371,35 +365,35 @@ int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *x
|
|||||||
dx[i] = (xp[i] - x2[i]) / dt;
|
dx[i] = (xp[i] - x2[i]) / dt;
|
||||||
/* store speed */
|
/* store speed */
|
||||||
for (i = 0; i <= 2; i++) {
|
for (i = 0; i <= 2; i++) {
|
||||||
xp[i+3] = dx[i];
|
xp[i + 3] = dx[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (xpret != NULL)
|
if (xpret != NULL)
|
||||||
for (i = 0; i <= 5; i++)
|
for (i = 0; i <= 5; i++)
|
||||||
xpret[i] = xp[i];
|
xpret[i] = xp[i];
|
||||||
}
|
}
|
||||||
return(OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Prepare lookup table of sin and cos ( i*Lj )
|
/* Prepare lookup table of sin and cos ( i*Lj )
|
||||||
* for required multiple angles
|
* for required multiple angles
|
||||||
*/
|
*/
|
||||||
static void sscc (int k, double arg, int n)
|
static void
|
||||||
|
sscc(int k, double arg, int n)
|
||||||
{
|
{
|
||||||
double cu, su, cv, sv, s;
|
double cu, su, cv, sv, s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
su = sin (arg);
|
su = sin(arg);
|
||||||
cu = cos (arg);
|
cu = cos(arg);
|
||||||
ss[k][0] = su; /* sin(L) */
|
ss[k][0] = su; /* sin(L) */
|
||||||
cc[k][0] = cu; /* cos(L) */
|
cc[k][0] = cu; /* cos(L) */
|
||||||
sv = 2.0 * su * cu;
|
sv = 2.0 * su * cu;
|
||||||
cv = cu * cu - su * su;
|
cv = cu * cu - su * su;
|
||||||
ss[k][1] = sv; /* sin(2L) */
|
ss[k][1] = sv; /* sin(2L) */
|
||||||
cc[k][1] = cv;
|
cc[k][1] = cv;
|
||||||
for (i = 2; i < n; i++)
|
for (i = 2; i < n; i++) {
|
||||||
{
|
|
||||||
s = su * cv + cu * sv;
|
s = su * cv + cu * sv;
|
||||||
cv = cu * cv - su * sv;
|
cv = cu * cv - su * sv;
|
||||||
sv = s;
|
sv = s;
|
||||||
@ -414,7 +408,8 @@ static void sscc (int k, double arg, int n)
|
|||||||
* J = Julian day number
|
* J = Julian day number
|
||||||
* xemb = rectangular equatorial coordinates of Earth
|
* xemb = rectangular equatorial coordinates of Earth
|
||||||
*/
|
*/
|
||||||
static void embofs_mosh(double tjd, double *xemb)
|
static void
|
||||||
|
embofs_mosh(double tjd, double *xemb)
|
||||||
{
|
{
|
||||||
double T, M, a, L, B, p;
|
double T, M, a, L, B, p;
|
||||||
double smp, cmp, s2mp, c2mp, s2d, c2d, sf, cf;
|
double smp, cmp, s2mp, c2mp, s2d, c2d, sf, cf;
|
||||||
@ -424,60 +419,56 @@ static void embofs_mosh(double tjd, double *xemb)
|
|||||||
int i;
|
int i;
|
||||||
/* Short series for position of the Moon
|
/* Short series for position of the Moon
|
||||||
*/
|
*/
|
||||||
T = (tjd-J1900)/36525.0;
|
T = (tjd - J1900) / 36525.0;
|
||||||
/* Mean anomaly of moon (MP) */
|
/* Mean anomaly of moon (MP) */
|
||||||
a = swe_degnorm(((1.44e-5*T + 0.009192)*T + 477198.8491)*T + 296.104608);
|
a = swe_degnorm(((1.44e-5 * T + 0.009192) * T + 477198.8491) * T +
|
||||||
|
296.104608);
|
||||||
a *= DEGTORAD;
|
a *= DEGTORAD;
|
||||||
smp = sin(a);
|
smp = sin(a);
|
||||||
cmp = cos(a);
|
cmp = cos(a);
|
||||||
s2mp = 2.0*smp*cmp; /* sin(2MP) */
|
s2mp = 2.0 * smp * cmp; /* sin(2MP) */
|
||||||
c2mp = cmp*cmp - smp*smp; /* cos(2MP) */
|
c2mp = cmp * cmp - smp * smp; /* cos(2MP) */
|
||||||
/* Mean elongation of moon (D) */
|
/* Mean elongation of moon (D) */
|
||||||
a = swe_degnorm(((1.9e-6*T - 0.001436)*T + 445267.1142)*T + 350.737486);
|
a = swe_degnorm(((1.9e-6 * T - 0.001436) * T + 445267.1142) * T +
|
||||||
|
350.737486);
|
||||||
a = 2.0 * DEGTORAD * a;
|
a = 2.0 * DEGTORAD * a;
|
||||||
s2d = sin(a);
|
s2d = sin(a);
|
||||||
c2d = cos(a);
|
c2d = cos(a);
|
||||||
/* Mean distance of moon from its ascending node (F) */
|
/* Mean distance of moon from its ascending node (F) */
|
||||||
a = swe_degnorm((( -3.e-7*T - 0.003211)*T + 483202.0251)*T + 11.250889);
|
a = swe_degnorm(((-3.e-7 * T - 0.003211) * T + 483202.0251) * T +
|
||||||
|
11.250889);
|
||||||
a *= DEGTORAD;
|
a *= DEGTORAD;
|
||||||
sf = sin(a);
|
sf = sin(a);
|
||||||
cf = cos(a);
|
cf = cos(a);
|
||||||
s2f = 2.0*sf*cf; /* sin(2F) */
|
s2f = 2.0 * sf * cf; /* sin(2F) */
|
||||||
sx = s2d*cmp - c2d*smp; /* sin(2D - MP) */
|
sx = s2d * cmp - c2d * smp; /* sin(2D - MP) */
|
||||||
cx = c2d*cmp + s2d*smp; /* cos(2D - MP) */
|
cx = c2d * cmp + s2d * smp; /* cos(2D - MP) */
|
||||||
/* Mean longitude of moon (LP) */
|
/* Mean longitude of moon (LP) */
|
||||||
L = ((1.9e-6*T - 0.001133)*T + 481267.8831)*T + 270.434164;
|
L = ((1.9e-6 * T - 0.001133) * T + 481267.8831) * T + 270.434164;
|
||||||
/* Mean anomaly of sun (M) */
|
/* Mean anomaly of sun (M) */
|
||||||
M = swe_degnorm((( -3.3e-6*T - 1.50e-4)*T + 35999.0498)*T + 358.475833);
|
M = swe_degnorm(((-3.3e-6 * T - 1.50e-4) * T + 35999.0498) * T +
|
||||||
|
358.475833);
|
||||||
/* Ecliptic longitude of the moon */
|
/* Ecliptic longitude of the moon */
|
||||||
L = L
|
L = L + 6.288750 * smp + 1.274018 * sx + 0.658309 * s2d +
|
||||||
+ 6.288750*smp
|
0.213616 * s2mp - 0.185596 * sin(DEGTORAD * M)
|
||||||
+ 1.274018*sx
|
- 0.114336 * s2f;
|
||||||
+ 0.658309*s2d
|
|
||||||
+ 0.213616*s2mp
|
|
||||||
- 0.185596*sin( DEGTORAD * M )
|
|
||||||
- 0.114336*s2f;
|
|
||||||
/* Ecliptic latitude of the moon */
|
/* Ecliptic latitude of the moon */
|
||||||
a = smp*cf;
|
a = smp * cf;
|
||||||
sx = cmp*sf;
|
sx = cmp * sf;
|
||||||
B = 5.128189*sf
|
B = 5.128189 * sf + 0.280606 * (a + sx) /* sin(MP+F) */
|
||||||
+ 0.280606*(a+sx) /* sin(MP+F) */
|
+0.277693 * (a - sx) /* sin(MP-F) */
|
||||||
+ 0.277693*(a-sx) /* sin(MP-F) */
|
+0.173238 * (s2d * cf - c2d * sf); /* sin(2D-F) */
|
||||||
+ 0.173238*(s2d*cf - c2d*sf); /* sin(2D-F) */
|
|
||||||
B *= DEGTORAD;
|
B *= DEGTORAD;
|
||||||
/* Parallax of the moon */
|
/* Parallax of the moon */
|
||||||
p = 0.950724
|
p = 0.950724 + 0.051818 * cmp + 0.009531 * cx + 0.007843 * c2d +
|
||||||
+0.051818*cmp
|
0.002824 * c2mp;
|
||||||
+0.009531*cx
|
|
||||||
+0.007843*c2d
|
|
||||||
+0.002824*c2mp;
|
|
||||||
p *= DEGTORAD;
|
p *= DEGTORAD;
|
||||||
/* Elongation of Moon from Sun
|
/* Elongation of Moon from Sun
|
||||||
*/
|
*/
|
||||||
L = swe_degnorm(L);
|
L = swe_degnorm(L);
|
||||||
L *= DEGTORAD;
|
L *= DEGTORAD;
|
||||||
/* Distance in au */
|
/* Distance in au */
|
||||||
a = 4.263523e-5/sin(p);
|
a = 4.263523e-5 / sin(p);
|
||||||
/* Convert to rectangular ecliptic coordinates */
|
/* Convert to rectangular ecliptic coordinates */
|
||||||
xyz[0] = L;
|
xyz[0] = L;
|
||||||
xyz[1] = B;
|
xyz[1] = B;
|
||||||
@ -486,7 +477,8 @@ static void embofs_mosh(double tjd, double *xemb)
|
|||||||
/* Convert to equatorial */
|
/* Convert to equatorial */
|
||||||
swi_coortrf2(xyz, xyz, -seps, ceps);
|
swi_coortrf2(xyz, xyz, -seps, ceps);
|
||||||
/* Precess to equinox of J2000.0 */
|
/* Precess to equinox of J2000.0 */
|
||||||
swi_precess(xyz, tjd, J_TO_J2000);/**/
|
swi_precess(xyz, tjd, J_TO_J2000);
|
||||||
|
/**/
|
||||||
/* now emb -> earth */
|
/* now emb -> earth */
|
||||||
for (i = 0; i <= 2; i++)
|
for (i = 0; i <= 2; i++)
|
||||||
xemb[i] -= xyz[i] / (EARTH_MOON_MRAT + 1.0);
|
xemb[i] -= xyz[i] / (EARTH_MOON_MRAT + 1.0);
|
||||||
@ -505,31 +497,33 @@ static void embofs_mosh(double tjd, double *xemb)
|
|||||||
#define SE_NEELY /* use James Neely's revised elements
|
#define SE_NEELY /* use James Neely's revised elements
|
||||||
* of Uranian planets*/
|
* of Uranian planets*/
|
||||||
static char *plan_fict_nam[SE_NFICT_ELEM] =
|
static char *plan_fict_nam[SE_NFICT_ELEM] =
|
||||||
{"Cupido", "Hades", "Zeus", "Kronos",
|
{ "Cupido", "Hades", "Zeus", "Kronos",
|
||||||
"Apollon", "Admetos", "Vulkanus", "Poseidon",
|
"Apollon", "Admetos", "Vulkanus", "Poseidon",
|
||||||
"Isis-Transpluto", "Nibiru", "Harrington",
|
"Isis-Transpluto", "Nibiru", "Harrington",
|
||||||
"Leverrier", "Adams",
|
"Leverrier", "Adams",
|
||||||
"Lowell", "Pickering",};
|
"Lowell", "Pickering",
|
||||||
|
};
|
||||||
|
|
||||||
char *swi_get_fict_name(int32 ipl, char *snam)
|
char *
|
||||||
|
swi_get_fict_name(int32 ipl, char *snam)
|
||||||
{
|
{
|
||||||
if (read_elements_file(ipl, 0, NULL, NULL,
|
if (read_elements_file
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
(ipl, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, snam, NULL,
|
||||||
snam, NULL, NULL) == ERR)
|
NULL) == ERR)
|
||||||
strcpy(snam, "name not found");
|
strcpy(snam, "name not found");
|
||||||
return snam;
|
return snam;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double plan_oscu_elem[SE_NFICT_ELEM][8] = {
|
static double plan_oscu_elem[SE_NFICT_ELEM][8] = {
|
||||||
#ifdef SE_NEELY
|
#ifdef SE_NEELY
|
||||||
{J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833},/* Cupido Neely */
|
{J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833}, /* Cupido Neely */
|
||||||
{J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500},/* Hades Neely */
|
{J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500}, /* Hades Neely */
|
||||||
{J1900, J1900, 165.1232, 59.21436, 0.00120, 299.0440, 0.0000, 0.0000},/* Zeus Neely */
|
{J1900, J1900, 165.1232, 59.21436, 0.00120, 299.0440, 0.0000, 0.0000}, /* Zeus Neely */
|
||||||
{J1900, J1900, 169.0193, 64.81960, 0.00305, 208.8801, 0.0000, 0.0000},/* Kronos Neely */
|
{J1900, J1900, 169.0193, 64.81960, 0.00305, 208.8801, 0.0000, 0.0000}, /* Kronos Neely */
|
||||||
{J1900, J1900, 138.0533, 70.29949, 0.00000, 0.0000, 0.0000, 0.0000},/* Apollon Neely */
|
{J1900, J1900, 138.0533, 70.29949, 0.00000, 0.0000, 0.0000, 0.0000}, /* Apollon Neely */
|
||||||
{J1900, J1900, 351.3350, 73.62765, 0.00000, 0.0000, 0.0000, 0.0000},/* Admetos Neely */
|
{J1900, J1900, 351.3350, 73.62765, 0.00000, 0.0000, 0.0000, 0.0000}, /* Admetos Neely */
|
||||||
{J1900, J1900, 55.8983, 77.25568, 0.00000, 0.0000, 0.0000, 0.0000},/* Vulcanus Neely */
|
{J1900, J1900, 55.8983, 77.25568, 0.00000, 0.0000, 0.0000, 0.0000}, /* Vulcanus Neely */
|
||||||
{J1900, J1900, 165.5163, 83.66907, 0.00000, 0.0000, 0.0000, 0.0000},/* Poseidon Neely */
|
{J1900, J1900, 165.5163, 83.66907, 0.00000, 0.0000, 0.0000, 0.0000}, /* Poseidon Neely */
|
||||||
#else
|
#else
|
||||||
{J1900, J1900, 104.5959, 40.99837, 0, 0, 0, 0}, /* Cupido */
|
{J1900, J1900, 104.5959, 40.99837, 0, 0, 0, 0}, /* Cupido */
|
||||||
{J1900, J1900, 337.4517, 50.667443, 0, 0, 0, 0}, /* Hades */
|
{J1900, J1900, 337.4517, 50.667443, 0, 0, 0, 0}, /* Hades */
|
||||||
@ -547,11 +541,12 @@ static double plan_oscu_elem[SE_NFICT_ELEM][8] = {
|
|||||||
* The fraction is counted from 1 Jan. 1772 */
|
* The fraction is counted from 1 Jan. 1772 */
|
||||||
{2368547.66, 2431456.5, 0.0, 77.775, 0.3, 0.7, 0, 0},
|
{2368547.66, 2431456.5, 0.0, 77.775, 0.3, 0.7, 0, 0},
|
||||||
/* Nibiru, elements from Christian Woeltge, Hannover */
|
/* Nibiru, elements from Christian Woeltge, Hannover */
|
||||||
{1856113.380954, 1856113.380954, 0.0, 234.8921, 0.981092, 103.966, -44.567, 158.708},
|
{1856113.380954, 1856113.380954, 0.0, 234.8921, 0.981092, 103.966,
|
||||||
|
-44.567, 158.708},
|
||||||
/* Harrington, elements from Astronomical Journal 96(4), Oct. 1988 */
|
/* Harrington, elements from Astronomical Journal 96(4), Oct. 1988 */
|
||||||
{2374696.5, J2000, 0.0, 101.2, 0.411, 208.5, 275.4, 32.4},
|
{2374696.5, J2000, 0.0, 101.2, 0.411, 208.5, 275.4, 32.4},
|
||||||
/* Leverrier's Neptune,
|
/* Leverrier's Neptune,
|
||||||
according to W.G. Hoyt, "Planets X and Pluto", Tucson 1980, p. 63 */
|
* according to W.G. Hoyt, "Planets X and Pluto", Tucson 1980, p. 63 */
|
||||||
{2395662.5, 2395662.5, 34.05, 36.15, 0.10761, 284.75, 0, 0},
|
{2395662.5, 2395662.5, 34.05, 36.15, 0.10761, 284.75, 0, 0},
|
||||||
/* Adam's Neptune */
|
/* Adam's Neptune */
|
||||||
{2395662.5, 2395662.5, 24.28, 37.25, 0.12062, 299.11, 0, 0},
|
{2395662.5, 2395662.5, 24.28, 37.25, 0.12062, 299.11, 0, 0},
|
||||||
@ -567,7 +562,8 @@ static double plan_oscu_elem[SE_NFICT_ELEM][8] = {
|
|||||||
0.7870946565779195e-01, 0.5809199028919189e+02,
|
0.7870946565779195e-01, 0.5809199028919189e+02,
|
||||||
0.8650119410725021e+02, 0.1066835622280712e+02},
|
0.8650119410725021e+02, 0.1066835622280712e+02},
|
||||||
/* Chiron, Bowell database 18-mar-1997 */
|
/* Chiron, Bowell database 18-mar-1997 */
|
||||||
{2450500.5, J2000, 7.258191, 13.67387471, 0.38174778, 339.558345, 209.379239, 6.933360}, /**/
|
{2450500.5, J2000, 7.258191, 13.67387471, 0.38174778, 339.558345,
|
||||||
|
209.379239, 6.933360}, /**/
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -577,7 +573,9 @@ static double plan_oscu_elem[SE_NFICT_ELEM][8] = {
|
|||||||
* ipli body number in planetary data structure
|
* ipli body number in planetary data structure
|
||||||
* iflag flags
|
* iflag flags
|
||||||
*/
|
*/
|
||||||
int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, double *xsun, char *serr)
|
int
|
||||||
|
swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth,
|
||||||
|
double *xsun, char *serr)
|
||||||
{
|
{
|
||||||
double pqr[9], x[6];
|
double pqr[9], x[6];
|
||||||
double eps, K, fac, rho, cose, sine;
|
double eps, K, fac, rho, cose, sine;
|
||||||
@ -592,8 +590,8 @@ int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, d
|
|||||||
/* orbital elements, either from file or, if file not found,
|
/* orbital elements, either from file or, if file not found,
|
||||||
* from above built-in set
|
* from above built-in set
|
||||||
*/
|
*/
|
||||||
if (read_elements_file(ipl, tjd, &tjd0, &tequ,
|
if (read_elements_file
|
||||||
&mano, &sema, &ecce, &parg, &node, &incl,
|
(ipl, tjd, &tjd0, &tequ, &mano, &sema, &ecce, &parg, &node, &incl,
|
||||||
NULL, &fict_ifl, serr) == ERR)
|
NULL, &fict_ifl, serr) == ERR)
|
||||||
return ERR;
|
return ERR;
|
||||||
dmot = 0.9856076686 * DEGTORAD / sema / sqrt(sema); /* daily motion */
|
dmot = 0.9856076686 * DEGTORAD / sema / sqrt(sema); /* daily motion */
|
||||||
@ -623,22 +621,26 @@ int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, d
|
|||||||
if (M2 > 150 && M2 < 210) {
|
if (M2 > 150 && M2 < 210) {
|
||||||
M2 -= 180;
|
M2 -= 180;
|
||||||
M_180_or_0 = 180;
|
M_180_or_0 = 180;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
M_180_or_0 = 0;
|
M_180_or_0 = 0;
|
||||||
if (M2 > 330)
|
if (M2 > 330)
|
||||||
M2 -= 360;
|
M2 -= 360;
|
||||||
if (M2 < 0) {
|
if (M2 < 0) {
|
||||||
M2 = -M2;
|
M2 = -M2;
|
||||||
Msgn = -1;
|
Msgn = -1;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
Msgn = 1;
|
Msgn = 1;
|
||||||
if (M2 < 30) {
|
if (M2 < 30) {
|
||||||
M2 *= DEGTORAD;
|
M2 *= DEGTORAD;
|
||||||
alpha = (1 - ecce) / (4 * ecce + 0.5);
|
alpha = (1 - ecce) / (4 * ecce + 0.5);
|
||||||
beta = M2 / (8 * ecce + 1);
|
beta = M2 / (8 * ecce + 1);
|
||||||
zeta = pow(beta + sqrt(beta * beta + alpha * alpha), 1/3);
|
zeta = pow(beta + sqrt(beta * beta + alpha * alpha), 1 / 3);
|
||||||
sigma = zeta - alpha / 2;
|
sigma = zeta - alpha / 2;
|
||||||
sigma = sigma - 0.078 * sigma * sigma * sigma * sigma * sigma / (1 + ecce);
|
sigma =
|
||||||
|
sigma - 0.078 * sigma * sigma * sigma * sigma * sigma / (1 +
|
||||||
|
ecce);
|
||||||
E = Msgn * (M2 + ecce * (3 * sigma - 4 * sigma * sigma * sigma))
|
E = Msgn * (M2 + ecce * (3 * sigma - 4 * sigma * sigma * sigma))
|
||||||
+ M_180_or_0;
|
+ M_180_or_0;
|
||||||
}
|
}
|
||||||
@ -667,18 +669,19 @@ int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, d
|
|||||||
/* transformation to equator */
|
/* transformation to equator */
|
||||||
eps = swi_epsiln(tequ);
|
eps = swi_epsiln(tequ);
|
||||||
swi_coortrf(xp, xp, -eps);
|
swi_coortrf(xp, xp, -eps);
|
||||||
swi_coortrf(xp+3, xp+3, -eps);
|
swi_coortrf(xp + 3, xp + 3, -eps);
|
||||||
/* precess to J2000 */
|
/* precess to J2000 */
|
||||||
if (tequ != J2000) {
|
if (tequ != J2000) {
|
||||||
swi_precess(xp, tequ, J_TO_J2000);
|
swi_precess(xp, tequ, J_TO_J2000);
|
||||||
swi_precess(xp+3, tequ, J_TO_J2000);
|
swi_precess(xp + 3, tequ, J_TO_J2000);
|
||||||
}
|
}
|
||||||
/* to solar system barycentre */
|
/* to solar system barycentre */
|
||||||
if (fict_ifl & FICT_GEO) {
|
if (fict_ifl & FICT_GEO) {
|
||||||
for (i = 0; i <= 5; i++) {
|
for (i = 0; i <= 5; i++) {
|
||||||
xp[i] += xearth[i];
|
xp[i] += xearth[i];
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
for (i = 0; i <= 5; i++) {
|
for (i = 0; i <= 5; i++) {
|
||||||
xp[i] += xsun[i];
|
xp[i] += xsun[i];
|
||||||
}
|
}
|
||||||
@ -691,12 +694,13 @@ int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, d
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
|
||||||
/* note: input parameter tjd is required for T terms in elements */
|
/* note: input parameter tjd is required for T terms in elements */
|
||||||
static int read_elements_file(int32 ipl, double tjd,
|
static int
|
||||||
double *tjd0, double *tequ,
|
read_elements_file(int32 ipl, double tjd, double *tjd0, double *tequ,
|
||||||
double *mano, double *sema, double *ecce,
|
double *mano, double *sema, double *ecce, double *parg,
|
||||||
double *parg, double *node, double *incl,
|
double *node, double *incl, char *pname, int32 * fict_ifl,
|
||||||
char *pname, int32 *fict_ifl, char *serr)
|
char *serr)
|
||||||
{
|
{
|
||||||
int i, iline, iplan, retc, ncpos;
|
int i, iline, iplan, retc, ncpos;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
@ -709,7 +713,9 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
/* file does not exist, use built-in bodies */
|
/* file does not exist, use built-in bodies */
|
||||||
if (ipl >= SE_NFICT_ELEM) {
|
if (ipl >= SE_NFICT_ELEM) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "error no elements for fictitious body no %7.0f", (double) ipl);
|
sprintf(serr,
|
||||||
|
"error no elements for fictitious body no %7.0f",
|
||||||
|
(double)ipl);
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
if (tjd0 != NULL)
|
if (tjd0 != NULL)
|
||||||
@ -740,7 +746,7 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
while (fgets(s, AS_MAXCH, fp) != NULL) {
|
while (fgets(s, AS_MAXCH, fp) != NULL) {
|
||||||
iline++;
|
iline++;
|
||||||
sp = s;
|
sp = s;
|
||||||
while(*sp == ' ' || *sp == '\t')
|
while (*sp == ' ' || *sp == '\t')
|
||||||
sp++;
|
sp++;
|
||||||
swi_strcpy(s, sp);
|
swi_strcpy(s, sp);
|
||||||
if (*s == '#')
|
if (*s == '#')
|
||||||
@ -754,8 +760,8 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
if ((sp = strchr(s, '#')) != NULL)
|
if ((sp = strchr(s, '#')) != NULL)
|
||||||
*sp = '\0';
|
*sp = '\0';
|
||||||
ncpos = swi_cutstr(s, ",", cpos, 20);
|
ncpos = swi_cutstr(s, ",", cpos, 20);
|
||||||
sprintf(serri, "error in file %s, line %7.0f:",
|
sprintf(serri, "error in file %s, line %7.0f:", SE_FICTFILE,
|
||||||
SE_FICTFILE, (double) iline);
|
(double)iline);
|
||||||
if (ncpos < 9) {
|
if (ncpos < 9) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "%s nine elements required", serri);
|
sprintf(serr, "%s nine elements required", serri);
|
||||||
@ -780,14 +786,15 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "%s invalid epoch", serri);
|
sprintf(serr, "%s invalid epoch", serri);
|
||||||
goto return_err;
|
goto return_err;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
*tjd0 = atof(sp);
|
*tjd0 = atof(sp);
|
||||||
tt = tjd - *tjd0;
|
tt = tjd - *tjd0;
|
||||||
}
|
}
|
||||||
/* equinox */
|
/* equinox */
|
||||||
if (tequ != NULL) {
|
if (tequ != NULL) {
|
||||||
sp = cpos[1];
|
sp = cpos[1];
|
||||||
while(*sp == ' ' || *sp == '\t')
|
while (*sp == ' ' || *sp == '\t')
|
||||||
sp++;
|
sp++;
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
sp[i] = tolower(sp[i]);
|
sp[i] = tolower(sp[i]);
|
||||||
@ -803,7 +810,8 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "%s invalid equinox", serri);
|
sprintf(serr, "%s invalid equinox", serri);
|
||||||
goto return_err;
|
goto return_err;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
*tequ = atof(sp);
|
*tequ = atof(sp);
|
||||||
}
|
}
|
||||||
/* mean anomaly t0 */
|
/* mean anomaly t0 */
|
||||||
@ -838,7 +846,9 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
retc = check_t_terms(tt, cpos[4], ecce);
|
retc = check_t_terms(tt, cpos[4], ecce);
|
||||||
if (*ecce >= 1 || *ecce < 0 || retc == ERR) {
|
if (*ecce >= 1 || *ecce < 0 || retc == ERR) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "%s eccentricity invalid (no parabolic or hyperbolic orbits allowed)", serri);
|
sprintf(serr,
|
||||||
|
"%s eccentricity invalid (no parabolic or hyperbolic orbits allowed)",
|
||||||
|
serri);
|
||||||
goto return_err;
|
goto return_err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -848,7 +858,8 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
*parg = swe_degnorm(*parg);
|
*parg = swe_degnorm(*parg);
|
||||||
if (retc == ERR) {
|
if (retc == ERR) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "%s perihelion argument value invalid", serri);
|
sprintf(serr, "%s perihelion argument value invalid",
|
||||||
|
serri);
|
||||||
goto return_err;
|
goto return_err;
|
||||||
}
|
}
|
||||||
*parg *= DEGTORAD;
|
*parg *= DEGTORAD;
|
||||||
@ -878,7 +889,7 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
/* planet name */
|
/* planet name */
|
||||||
if (pname != NULL) {
|
if (pname != NULL) {
|
||||||
sp = cpos[8];
|
sp = cpos[8];
|
||||||
while(*sp == ' ' || *sp == '\t')
|
while (*sp == ' ' || *sp == '\t')
|
||||||
sp++;
|
sp++;
|
||||||
swi_right_trim(sp);
|
swi_right_trim(sp);
|
||||||
strcpy(pname, sp);
|
strcpy(pname, sp);
|
||||||
@ -894,7 +905,8 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||||||
}
|
}
|
||||||
if (!elem_found) {
|
if (!elem_found) {
|
||||||
if (serr != NULL)
|
if (serr != NULL)
|
||||||
sprintf(serr, "%s elements for planet %7.0f not found", serri, (double) ipl);
|
sprintf(serr, "%s elements for planet %7.0f not found", serri,
|
||||||
|
(double)ipl);
|
||||||
goto return_err;
|
goto return_err;
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -905,7 +917,8 @@ return_err:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int check_t_terms(double t, char *sinp, double *doutp)
|
static int
|
||||||
|
check_t_terms(double t, char *sinp, double *doutp)
|
||||||
{
|
{
|
||||||
int i, isgn = 1, z;
|
int i, isgn = 1, z;
|
||||||
int retc = 0;
|
int retc = 0;
|
||||||
@ -923,7 +936,7 @@ static int check_t_terms(double t, char *sinp, double *doutp)
|
|||||||
fac = 1;
|
fac = 1;
|
||||||
z = 0;
|
z = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
while(*sp != '\0' && strchr(" \t", *sp) != NULL)
|
while (*sp != '\0' && strchr(" \t", *sp) != NULL)
|
||||||
sp++;
|
sp++;
|
||||||
if (strchr("+-", *sp) || *sp == '\0') {
|
if (strchr("+-", *sp) || *sp == '\0') {
|
||||||
if (z > 0)
|
if (z > 0)
|
||||||
@ -935,8 +948,9 @@ static int check_t_terms(double t, char *sinp, double *doutp)
|
|||||||
if (*sp == '\0')
|
if (*sp == '\0')
|
||||||
return retc;
|
return retc;
|
||||||
sp++;
|
sp++;
|
||||||
} else {
|
}
|
||||||
while(*sp != '\0' && strchr("* \t", *sp) != NULL)
|
else {
|
||||||
|
while (*sp != '\0' && strchr("* \t", *sp) != NULL)
|
||||||
sp++;
|
sp++;
|
||||||
if (*sp != '\0' && strchr("tT", *sp) != NULL) {
|
if (*sp != '\0' && strchr("tT", *sp) != NULL) {
|
||||||
/* a T */
|
/* a T */
|
||||||
@ -945,7 +959,8 @@ static int check_t_terms(double t, char *sinp, double *doutp)
|
|||||||
fac *= tt[0];
|
fac *= tt[0];
|
||||||
else if ((i = atoi(sp)) <= 4 && i >= 0)
|
else if ((i = atoi(sp)) <= 4 && i >= 0)
|
||||||
fac *= tt[i];
|
fac *= tt[i];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/* a number */
|
/* a number */
|
||||||
if (atof(sp) != 0 || *sp == '0')
|
if (atof(sp) != 0 || *sp == '0')
|
||||||
fac *= atof(sp);
|
fac *= atof(sp);
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
$Header: /home/dieter/sweph/RCS/sweodef.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/sweodef.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
||||||
definitions and constants for all Swiss Ephemeris source files,
|
definitions and constants for all Swiss Ephemeris source files,
|
||||||
@ -72,95 +73,95 @@
|
|||||||
#ifndef _SWEODEF_INCLUDED /* allow multiple #includes */
|
#ifndef _SWEODEF_INCLUDED /* allow multiple #includes */
|
||||||
#define _SWEODEF_INCLUDED
|
#define _SWEODEF_INCLUDED
|
||||||
|
|
||||||
# define MY_TRUE 1 /* for use in other defines, before TRUE is defined */
|
#define MY_TRUE 1 /* for use in other defines, before TRUE is defined */
|
||||||
# define MY_FALSE 0 /* for use in other defines, before TRUE is defined */
|
#define MY_FALSE 0 /* for use in other defines, before TRUE is defined */
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
|
#ifdef _WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
|
||||||
# undef MSDOS
|
#undef MSDOS
|
||||||
# define MSDOS MY_TRUE
|
#define MSDOS MY_TRUE
|
||||||
#include <wtypes.h>
|
#include <wtypes.h>
|
||||||
#include <objbase.h>
|
#include <objbase.h>
|
||||||
#include <wincon.h>
|
#include <wincon.h>
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
# define sleep(x) Sleep((x) * 1000)
|
#define sleep(x) Sleep((x) * 1000)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# define MS_VC
|
#define MS_VC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
|
#ifdef WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
|
||||||
# define MSDOS MY_TRUE
|
#define MSDOS MY_TRUE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MSDOS /* already defined by some DOS compilers */
|
#ifdef MSDOS /* already defined by some DOS compilers */
|
||||||
# undef MSDOS
|
#undef MSDOS
|
||||||
# define MSDOS MY_TRUE
|
#define MSDOS MY_TRUE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __TURBOC__ /* defined by turboc */
|
#ifdef __TURBOC__ /* defined by turboc */
|
||||||
# ifndef MSDOS
|
#ifndef MSDOS
|
||||||
# define MSDOS MY_TRUE
|
#define MSDOS MY_TRUE
|
||||||
# endif
|
#endif
|
||||||
# define TURBO_C
|
#define TURBO_C
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __SC__ /* defined by Symantec C */
|
#ifdef __SC__ /* defined by Symantec C */
|
||||||
# ifndef MSDOS
|
#ifndef MSDOS
|
||||||
# define MSDOS MY_TRUE
|
#define MSDOS MY_TRUE
|
||||||
# endif
|
#endif
|
||||||
# define SYMANTEC_C
|
#define SYMANTEC_C
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WATCOMC__ /* defined by WatcomC */
|
#ifdef __WATCOMC__ /* defined by WatcomC */
|
||||||
# ifndef MSDOS
|
#ifndef MSDOS
|
||||||
# define MSDOS MY_TRUE
|
#define MSDOS MY_TRUE
|
||||||
# endif
|
#endif
|
||||||
# define WATCOMC
|
#define WATCOMC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __MWERKS__ /* defined on Macintosh CodeWarrior */
|
#ifdef __MWERKS__ /* defined on Macintosh CodeWarrior */
|
||||||
# if macintosh && powerc
|
#if macintosh && powerc
|
||||||
# define MACOS MY_TRUE /* let it undefined otherwise */
|
#define MACOS MY_TRUE /* let it undefined otherwise */
|
||||||
# define MSDOS MY_FALSE /* in case one above fired falsely */
|
#define MSDOS MY_FALSE /* in case one above fired falsely */
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MSDOS
|
#ifdef MSDOS
|
||||||
# define HPUNIX MY_FALSE
|
#define HPUNIX MY_FALSE
|
||||||
# define INTEL_BYTE_ORDER 1
|
#define INTEL_BYTE_ORDER 1
|
||||||
# ifndef TURBO_C
|
#ifndef TURBO_C
|
||||||
# define MS_C /* assume Microsoft C compiler */
|
#define MS_C /* assume Microsoft C compiler */
|
||||||
# endif
|
#endif
|
||||||
# define MYFAR far
|
#define MYFAR far
|
||||||
# define UNIX_FS MY_FALSE
|
#define UNIX_FS MY_FALSE
|
||||||
#else
|
#else
|
||||||
# ifdef MACOS
|
#ifdef MACOS
|
||||||
# define HPUNIX MY_FALSE
|
#define HPUNIX MY_FALSE
|
||||||
# define MYFAR
|
#define MYFAR
|
||||||
# define UNIX_FS MY_FALSE
|
#define UNIX_FS MY_FALSE
|
||||||
# else
|
#else
|
||||||
# define MSDOS MY_FALSE
|
#define MSDOS MY_FALSE
|
||||||
# define HPUNIX MY_TRUE
|
#define HPUNIX MY_TRUE
|
||||||
# ifndef _HPUX_SOURCE
|
#ifndef _HPUX_SOURCE
|
||||||
# define _HPUX_SOURCE
|
#define _HPUX_SOURCE
|
||||||
# endif
|
#endif
|
||||||
# define MYFAR
|
#define MYFAR
|
||||||
# define UNIX_FS MY_TRUE
|
#define UNIX_FS MY_TRUE
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifndef FILE
|
#ifndef FILE
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HPUNIX
|
#if HPUNIX
|
||||||
# include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -170,63 +171,63 @@
|
|||||||
*/
|
*/
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#if INT_MAX < 40000
|
#if INT_MAX < 40000
|
||||||
# define INT_16
|
#define INT_16
|
||||||
#else
|
#else
|
||||||
# if LONG_MAX > INT_MAX
|
#if LONG_MAX > INT_MAX
|
||||||
# define LONG_64
|
#define LONG_64
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BYTE_ORDER
|
#ifdef BYTE_ORDER
|
||||||
#ifdef LITTLE_ENDIAN
|
#ifdef LITTLE_ENDIAN
|
||||||
# if BYTE_ORDER == LITTLE_ENDIAN
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
# define INTEL_BYTE_ORDER
|
#define INTEL_BYTE_ORDER
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef INT_16
|
#ifdef INT_16
|
||||||
typedef long int32;
|
typedef long int32;
|
||||||
typedef unsigned long uint32;
|
typedef unsigned long uint32;
|
||||||
typedef int int16;
|
typedef int int16;
|
||||||
typedef double REAL8; /* real with at least 64 bit precision */
|
typedef double REAL8; /* real with at least 64 bit precision */
|
||||||
typedef long INT4; /* signed integer with at least 32 bit precision */
|
typedef long INT4; /* signed integer with at least 32 bit precision */
|
||||||
typedef unsigned long UINT4;
|
typedef unsigned long UINT4;
|
||||||
/* unsigned integer with at least 32 bit precision */
|
/* unsigned integer with at least 32 bit precision */
|
||||||
typedef int AS_BOOL;
|
typedef int AS_BOOL;
|
||||||
typedef unsigned int UINT2; /* unsigned 16 bits */
|
typedef unsigned int UINT2; /* unsigned 16 bits */
|
||||||
# define ABS4 labs /* abs function for long */
|
#define ABS4 labs /* abs function for long */
|
||||||
#else
|
#else
|
||||||
typedef int int32;
|
typedef int int32;
|
||||||
typedef long long int64;
|
typedef long long int64;
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
typedef short int16;
|
typedef short int16;
|
||||||
typedef double REAL8; /* real with at least 64 bit precision */
|
typedef double REAL8; /* real with at least 64 bit precision */
|
||||||
typedef int INT4; /* signed integer with at least 32 bit precision */
|
typedef int INT4; /* signed integer with at least 32 bit precision */
|
||||||
typedef unsigned int UINT4;
|
typedef unsigned int UINT4;
|
||||||
/* unsigned integer with at least 32 bit precision */
|
/* unsigned integer with at least 32 bit precision */
|
||||||
typedef int AS_BOOL;
|
typedef int AS_BOOL;
|
||||||
typedef unsigned short UINT2; /* unsigned 16 bits */
|
typedef unsigned short UINT2; /* unsigned 16 bits */
|
||||||
# define ABS4 abs /* abs function for long */
|
#define ABS4 abs /* abs function for long */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MSDOS
|
#if MSDOS
|
||||||
# ifdef TURBO_C
|
#ifdef TURBO_C
|
||||||
# include <alloc.h> /* MSC needs malloc ! */
|
#include <alloc.h> /* MSC needs malloc ! */
|
||||||
# else
|
#else
|
||||||
# include <malloc.h>
|
#include <malloc.h>
|
||||||
# endif
|
#endif
|
||||||
# define SIGALRM SIGINT
|
#define SIGALRM SIGINT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
# define TRUE 1
|
#define TRUE 1
|
||||||
# define FALSE 0
|
#define FALSE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef OK
|
#ifndef OK
|
||||||
# define OK (0)
|
#define OK (0)
|
||||||
# define ERR (-1)
|
#define ERR (-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* hack because UCHAR is already used by mingw gcc */
|
/* hack because UCHAR is already used by mingw gcc */
|
||||||
@ -240,15 +241,15 @@ typedef unsigned char UCHAR;
|
|||||||
#define UCP (UCHAR*)
|
#define UCP (UCHAR*)
|
||||||
#define SCP (char*)
|
#define SCP (char*)
|
||||||
|
|
||||||
# define ODEGREE_STRING "°" /* degree as string, utf8 encoding */
|
#define ODEGREE_STRING "°" /* degree as string, utf8 encoding */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HUGE
|
#ifndef HUGE
|
||||||
# define HUGE 1.7E+308 /* biggest value for REAL8 */
|
#define HUGE 1.7E+308 /* biggest value for REAL8 */
|
||||||
#endif
|
#endif
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
# define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define forward static
|
#define forward static
|
||||||
@ -282,40 +283,41 @@ typedef int32 centisec; /* centiseconds used for angles and times */
|
|||||||
|
|
||||||
/* control strings for fopen() */
|
/* control strings for fopen() */
|
||||||
#if UNIX_FS
|
#if UNIX_FS
|
||||||
# define BFILE_R_ACCESS "r" /* open binary file for reading */
|
#define BFILE_R_ACCESS "r" /* open binary file for reading */
|
||||||
# define BFILE_RW_ACCESS "r+" /* open binary file for writing and reading */
|
#define BFILE_RW_ACCESS "r+" /* open binary file for writing and reading */
|
||||||
# define BFILE_W_CREATE "w" /* create/open binary file for write*/
|
#define BFILE_W_CREATE "w" /* create/open binary file for write */
|
||||||
# define BFILE_A_ACCESS "a+" /* create/open binary file for append*/
|
#define BFILE_A_ACCESS "a+" /* create/open binary file for append */
|
||||||
# define FILE_R_ACCESS "r" /* open text file for reading */
|
#define FILE_R_ACCESS "r" /* open text file for reading */
|
||||||
# define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
|
#define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
|
||||||
# define FILE_W_CREATE "w" /* create/open text file for write*/
|
#define FILE_W_CREATE "w" /* create/open text file for write */
|
||||||
# define FILE_A_ACCESS "a+" /* create/open text file for append*/
|
#define FILE_A_ACCESS "a+" /* create/open text file for append */
|
||||||
# define O_BINARY 0 /* for open(), not defined in Unix */
|
#define O_BINARY 0 /* for open(), not defined in Unix */
|
||||||
# define OPEN_MODE 0666 /* default file creation mode */
|
#define OPEN_MODE 0666 /* default file creation mode */
|
||||||
# define DIR_GLUE "/" /* glue string for directory/file */
|
#define DIR_GLUE "/" /* glue string for directory/file */
|
||||||
# define PATH_SEPARATOR ";:" /* semicolon or colon may be used */
|
#define PATH_SEPARATOR ";:" /* semicolon or colon may be used */
|
||||||
#else
|
#else
|
||||||
# define BFILE_R_ACCESS "rb" /* open binary file for reading */
|
#define BFILE_R_ACCESS "rb" /* open binary file for reading */
|
||||||
# define BFILE_RW_ACCESS "r+b" /* open binary file for writing and reading */
|
#define BFILE_RW_ACCESS "r+b" /* open binary file for writing and reading */
|
||||||
# define BFILE_W_CREATE "wb" /* create/open binary file for write*/
|
#define BFILE_W_CREATE "wb" /* create/open binary file for write */
|
||||||
# define BFILE_A_ACCESS "a+b" /* create/open binary file for append*/
|
#define BFILE_A_ACCESS "a+b" /* create/open binary file for append */
|
||||||
# define PATH_SEPARATOR ";" /* semicolon as PATH separator */
|
#define PATH_SEPARATOR ";" /* semicolon as PATH separator */
|
||||||
# define OPEN_MODE 0666 /* default file creation mode */
|
#define OPEN_MODE 0666 /* default file creation mode */
|
||||||
# ifdef MACOS
|
#ifdef MACOS
|
||||||
# define FILE_R_ACCESS "r" /* open text file for reading */
|
#define FILE_R_ACCESS "r" /* open text file for reading */
|
||||||
# define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
|
#define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
|
||||||
# define FILE_W_CREATE "w" /* create/open text file for write*/
|
#define FILE_W_CREATE "w" /* create/open text file for write */
|
||||||
# define FILE_A_ACCESS "a+" /* create/open text file for append*/
|
#define FILE_A_ACCESS "a+" /* create/open text file for append */
|
||||||
# define DIR_GLUE ":" /* glue string for directory/file */
|
#define DIR_GLUE ":" /* glue string for directory/file */
|
||||||
# else
|
#else
|
||||||
# define FILE_R_ACCESS "rt" /* open text file for reading */
|
#define FILE_R_ACCESS "rt" /* open text file for reading */
|
||||||
# define FILE_RW_ACCESS "r+t" /* open text file for writing and reading */
|
#define FILE_RW_ACCESS "r+t" /* open text file for writing and reading */
|
||||||
# define FILE_W_CREATE "wt" /* create/open text file for write*/
|
#define FILE_W_CREATE "wt" /* create/open text file for write */
|
||||||
# define FILE_A_ACCESS "a+t" /* create/open text file for append*/
|
#define FILE_A_ACCESS "a+t" /* create/open text file for append */
|
||||||
|
|
||||||
/* attention, all backslashes for msdos directry names must be written as \\,
|
/* attention, all backslashes for msdos directry names must be written as \\,
|
||||||
because it is the C escape character */
|
because it is the C escape character */
|
||||||
# define DIR_GLUE "\\" /* glue string for directory/file */
|
#define DIR_GLUE "\\" /* glue string for directory/file */
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
$Header: /home/dieter/sweph/RCS/swepcalc.c,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/swepcalc.c,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
||||||
Placalc compatibility interface for Swiss Ephemeris.
|
Placalc compatibility interface for Swiss Ephemeris.
|
||||||
|
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -80,7 +82,12 @@ Placalc compatibility interface for Swiss Ephemeris.
|
|||||||
local globals, not exported
|
local globals, not exported
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
static int plac2swe[] = {SE_SUN, SE_MOON, SE_MERCURY, SE_VENUS, SE_MARS, SE_JUPITER, SE_SATURN, SE_URANUS, SE_NEPTUNE, SE_PLUTO, SE_MEAN_NODE, SE_TRUE_NODE, SE_CHIRON, SE_MEAN_APOG, SE_CERES, SE_PALLAS, SE_JUNO, SE_VESTA,};
|
static int plac2swe[] =
|
||||||
|
{ SE_SUN, SE_MOON, SE_MERCURY, SE_VENUS, SE_MARS, SE_JUPITER, SE_SATURN,
|
||||||
|
SE_URANUS, SE_NEPTUNE, SE_PLUTO, SE_MEAN_NODE, SE_TRUE_NODE, SE_CHIRON,
|
||||||
|
SE_MEAN_APOG,
|
||||||
|
SE_CERES, SE_PALLAS, SE_JUNO, SE_VESTA,
|
||||||
|
};
|
||||||
|
|
||||||
/* If there occurs an internal error in placalc, a message is
|
/* If there occurs an internal error in placalc, a message is
|
||||||
* written into the string variable perrtx.
|
* written into the string variable perrtx.
|
||||||
@ -95,19 +102,20 @@ static double ekl, nut;
|
|||||||
* as 100 when a planet is closest and as 0 when farthest from earth.
|
* as 100 when a planet is closest and as 0 when farthest from earth.
|
||||||
*/
|
*/
|
||||||
static double rmima[CALC_N][2] = {
|
static double rmima[CALC_N][2] = {
|
||||||
{ 0.98296342, 1.01704665},
|
{0.98296342, 1.01704665},
|
||||||
{ 0.00238267, 0.00271861},
|
{0.00238267, 0.00271861},
|
||||||
{ 0.54900496, 1.45169607},
|
{0.54900496, 1.45169607},
|
||||||
{ 0.26411287, 1.73597885},
|
{0.26411287, 1.73597885},
|
||||||
{ 0.37289847, 2.67626927},
|
{0.37289847, 2.67626927},
|
||||||
{ 3.94877993, 6.45627627},
|
{3.94877993, 6.45627627},
|
||||||
{ 7.99362824, 11.09276636},
|
{7.99362824, 11.09276636},
|
||||||
{17.28622633, 21.10714104},
|
{17.28622633, 21.10714104},
|
||||||
{28.81374786, 31.33507284},
|
{28.81374786, 31.33507284},
|
||||||
{28.67716748, 50.29208774},
|
{28.67716748, 50.29208774},
|
||||||
{ 0.00, 0.00259553}, /* nodes don't get a real value*/
|
{0.00, 0.00259553}, /* nodes don't get a real value */
|
||||||
{ 0.00, 0.00259553},
|
{0.00, 0.00259553},
|
||||||
{ 7.36277475, 19.86585062}};
|
{7.36277475, 19.86585062}
|
||||||
|
};
|
||||||
|
|
||||||
/**********************************************************
|
/**********************************************************
|
||||||
function nacalc ()
|
function nacalc ()
|
||||||
@ -124,9 +132,10 @@ coordinate format for fast mathematics with planetary positions.
|
|||||||
This function is just a template of how the calc() package
|
This function is just a template of how the calc() package
|
||||||
can be used.
|
can be used.
|
||||||
**********************************************************/
|
**********************************************************/
|
||||||
int nacalc (double jd_ad, /* universal time relative julian date */
|
int
|
||||||
centisec *plon, /* returned longitudes */
|
nacalc(double jd_ad, /* universal time relative julian date */
|
||||||
centisec *pspe /* returned speeds, if not NULL pointer */
|
centisec * plon, /* returned longitudes */
|
||||||
|
centisec * pspe /* returned speeds, if not NULL pointer */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
char err[AS_MAXCH];
|
char err[AS_MAXCH];
|
||||||
@ -134,14 +143,17 @@ int nacalc (double jd_ad, /* universal time relative julian date */
|
|||||||
double rlng, rrad, rlat, rspeed;
|
double rlng, rrad, rlat, rspeed;
|
||||||
int result = OK;
|
int result = OK;
|
||||||
flag = CALC_BIT_SPEED; /* same, with speed */
|
flag = CALC_BIT_SPEED; /* same, with speed */
|
||||||
jd_ad += deltat( jd_ad ); /* ET = UT + Delta_T */
|
jd_ad += deltat(jd_ad); /* ET = UT + Delta_T */
|
||||||
for (planet = SUN; planet <= MAXPL_NACALC; planet++) {
|
for (planet = SUN; planet <= MAXPL_NACALC; planet++) {
|
||||||
if (calc (planet, jd_ad, flag, &rlng, &rrad, &rlat, &rspeed) == OK) {
|
if (calc(planet, jd_ad, flag, &rlng, &rrad, &rlat, &rspeed) == OK) {
|
||||||
plon [planet] = swe_csnorm(swe_d2l (rlng * DEG));
|
plon[planet] = swe_csnorm(swe_d2l(rlng * DEG));
|
||||||
if (pspe != NULL) pspe [planet] = swe_d2l (rspeed * DEG);
|
if (pspe != NULL)
|
||||||
} else {
|
pspe[planet] = swe_d2l(rspeed * DEG);
|
||||||
plon [planet] = -1;
|
}
|
||||||
if (pspe != NULL) pspe [planet] = 0;
|
else {
|
||||||
|
plon[planet] = -1;
|
||||||
|
if (pspe != NULL)
|
||||||
|
pspe[planet] = 0;
|
||||||
if (result != ERR) { /* save first error message */
|
if (result != ERR) { /* save first error message */
|
||||||
strcpy(err, placalc_get_errtext());
|
strcpy(err, placalc_get_errtext());
|
||||||
}
|
}
|
||||||
@ -159,35 +171,39 @@ int nacalc (double jd_ad, /* universal time relative julian date */
|
|||||||
* over a communication line to the calculation client.
|
* over a communication line to the calculation client.
|
||||||
* if plalist = 0, only SUN .. CHIRON are delivered, no LILITH
|
* if plalist = 0, only SUN .. CHIRON are delivered, no LILITH
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
int calcserv(int id, /* request id, random number to prevent phase err */
|
int
|
||||||
|
calcserv(int id, /* request id, random number to prevent phase err */
|
||||||
double jd_ad, /* time as relative Astrodienst julian date */
|
double jd_ad, /* time as relative Astrodienst julian date */
|
||||||
int flag, /* a set of CALC_BIT_ bitflags */
|
int flag, /* a set of CALC_BIT_ bitflags */
|
||||||
int plalist,/* bit list of planets to be computed, 0 = all */
|
int plalist, /* bit list of planets to be computed, 0 = all */
|
||||||
char *so) /* output string, MUST BE LONG ENOUGH (800 bytes)*/
|
char *so)
|
||||||
{
|
{ /* output string, MUST BE LONG ENOUGH (800 bytes) */
|
||||||
int p, planet, so_len;
|
int p, planet, so_len;
|
||||||
double rlng, rrad, rlat, rspeed, rau[CALC_N];
|
double rlng, rrad, rlat, rspeed, rau[CALC_N];
|
||||||
centisec lcs[CALC_N], lpcs[CALC_N], betcs[CALC_N];
|
centisec lcs[CALC_N], lpcs[CALC_N], betcs[CALC_N];
|
||||||
char s[AS_MAXCH];
|
char s[AS_MAXCH];
|
||||||
if (plalist == 0) plalist = (1 << 13) - 1; /* sun .. chiron */;
|
if (plalist == 0)
|
||||||
|
plalist = (1 << 13) - 1; /* sun .. chiron */ ;
|
||||||
/*
|
/*
|
||||||
* flag determines whether deltat is added to t;
|
* flag determines whether deltat is added to t;
|
||||||
* if CALC_BIT_EPHE is set, jd_ad is considered as ephemeris time,
|
* if CALC_BIT_EPHE is set, jd_ad is considered as ephemeris time,
|
||||||
* otherwise as universal time.
|
* otherwise as universal time.
|
||||||
*/
|
*/
|
||||||
if ((flag & CALC_BIT_EPHE) == 0) {
|
if ((flag & CALC_BIT_EPHE) == 0) {
|
||||||
jd_ad += deltat (jd_ad);
|
jd_ad += deltat(jd_ad);
|
||||||
}
|
}
|
||||||
for (p = SUN; p < CALC_N; p++) {
|
for (p = SUN; p < CALC_N; p++) {
|
||||||
if (! check_bit(plalist, p)) continue;
|
if (!check_bit(plalist, p))
|
||||||
if (calc (p, jd_ad, flag, &rlng, &rrad, &rlat, &rspeed) == OK) {
|
continue;
|
||||||
lcs [p] = swe_d2l (rlng * DEG);
|
if (calc(p, jd_ad, flag, &rlng, &rrad, &rlat, &rspeed) == OK) {
|
||||||
lpcs [p] = swe_d2l (rspeed * DEG);
|
lcs[p] = swe_d2l(rlng * DEG);
|
||||||
betcs [p] = swe_d2l (rlat * DEG);
|
lpcs[p] = swe_d2l(rspeed * DEG);
|
||||||
rau [p] = rrad;
|
betcs[p] = swe_d2l(rlat * DEG);
|
||||||
} else {
|
rau[p] = rrad;
|
||||||
sprintf(so,"error at planet %d", p);
|
}
|
||||||
return ( ERR);
|
else {
|
||||||
|
sprintf(so, "error at planet %d", p);
|
||||||
|
return (ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -200,45 +216,50 @@ int calcserv(int id, /* request id, random number to prevent phase err */
|
|||||||
* then for each requested planet, if wanted: rgeo (units 0..999)
|
* then for each requested planet, if wanted: rgeo (units 0..999)
|
||||||
* then for each requested planet, if wanted: rau (A.U.)
|
* then for each requested planet, if wanted: rau (A.U.)
|
||||||
*/
|
*/
|
||||||
sprintf (so, "%d,%.8f,%d,%d,%d,%d", id, jd_ad, flag, plalist,
|
sprintf(so, "%d,%.8f,%d,%d,%d,%d", id, jd_ad, flag, plalist,
|
||||||
swe_d2l(ekl * DEG), swe_d2l (nut * DEG) );
|
swe_d2l(ekl * DEG), swe_d2l(nut * DEG));
|
||||||
so_len = strlen (so);
|
so_len = strlen(so);
|
||||||
for (planet = SUN; planet < CALC_N; planet++) {
|
for (planet = SUN; planet < CALC_N; planet++) {
|
||||||
if (! check_bit(plalist, planet)) continue;
|
if (!check_bit(plalist, planet))
|
||||||
sprintf (s ,",%d", lcs[planet]);
|
continue;
|
||||||
strcat (so + so_len, s);
|
sprintf(s, ",%d", lcs[planet]);
|
||||||
so_len += strlen (s);
|
strcat(so + so_len, s);
|
||||||
|
so_len += strlen(s);
|
||||||
}
|
}
|
||||||
if (flag & CALC_BIT_SPEED) {
|
if (flag & CALC_BIT_SPEED) {
|
||||||
for (planet = SUN; planet < CALC_N; planet++) {
|
for (planet = SUN; planet < CALC_N; planet++) {
|
||||||
if (! check_bit(plalist, planet)) continue;
|
if (!check_bit(plalist, planet))
|
||||||
sprintf (s ,",%d", lpcs[planet]);
|
continue;
|
||||||
strcat (so + so_len, s);
|
sprintf(s, ",%d", lpcs[planet]);
|
||||||
so_len += strlen (s);
|
strcat(so + so_len, s);
|
||||||
|
so_len += strlen(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag & CALC_BIT_BETA) {
|
if (flag & CALC_BIT_BETA) {
|
||||||
for (planet = SUN; planet < CALC_N; planet++) {
|
for (planet = SUN; planet < CALC_N; planet++) {
|
||||||
if (! check_bit(plalist, planet)) continue;
|
if (!check_bit(plalist, planet))
|
||||||
sprintf (s ,",%d", betcs[planet]);
|
continue;
|
||||||
strcat (so + so_len, s);
|
sprintf(s, ",%d", betcs[planet]);
|
||||||
so_len += strlen (s);
|
strcat(so + so_len, s);
|
||||||
|
so_len += strlen(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag & CALC_BIT_RGEO) {
|
if (flag & CALC_BIT_RGEO) {
|
||||||
for (planet = SUN; planet < CALC_N; planet++) {
|
for (planet = SUN; planet < CALC_N; planet++) {
|
||||||
if (! check_bit(plalist, planet)) continue;
|
if (!check_bit(plalist, planet))
|
||||||
sprintf (s ,",%d", rel_geo(planet,rau[planet]));
|
continue;
|
||||||
strcat (so + so_len, s);
|
sprintf(s, ",%d", rel_geo(planet, rau[planet]));
|
||||||
so_len += strlen (s);
|
strcat(so + so_len, s);
|
||||||
|
so_len += strlen(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag & CALC_BIT_RAU) {
|
if (flag & CALC_BIT_RAU) {
|
||||||
for (planet = SUN; planet < CALC_N; planet++) {
|
for (planet = SUN; planet < CALC_N; planet++) {
|
||||||
if (! check_bit(plalist, planet)) continue;
|
if (!check_bit(plalist, planet))
|
||||||
sprintf (s ,",%.8f", rau[planet]);
|
continue;
|
||||||
strcat (so + so_len, s);
|
sprintf(s, ",%.8f", rau[planet]);
|
||||||
so_len += strlen (s);
|
strcat(so + so_len, s);
|
||||||
|
so_len += strlen(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (OK);
|
return (OK);
|
||||||
@ -276,21 +297,19 @@ int calcserv(int id, /* request id, random number to prevent phase err */
|
|||||||
will return the values for time teph.
|
will return the values for time teph.
|
||||||
|
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
int calc(int planet, /* planet index as defined in placalc.h,
|
int
|
||||||
SUN = 0, MOON = 1 etc.
|
calc(int planet, /* planet index as defined in placalc.h,
|
||||||
planet == -1 calc calculates only nut, ekl, meanekl */
|
* SUN = 0, MOON = 1 etc.
|
||||||
|
* planet == -1 calc calculates only nut, ekl, meanekl */
|
||||||
double jd_ad, /* relative Astrodienst Juldate, ephemeris time.
|
double jd_ad, /* relative Astrodienst Juldate, ephemeris time.
|
||||||
Astrodienst Juldate is relative 31 Dec 1949, noon. */
|
* Astrodienst Juldate is relative 31 Dec 1949, noon. */
|
||||||
int flag, /* See definition of flag bits above */
|
int flag, /* See definition of flag bits above */
|
||||||
double *alng,
|
double *alng, double *arad, double *alat, double *alngspeed)
|
||||||
double *arad,
|
|
||||||
double *alat,
|
|
||||||
double *alngspeed)
|
|
||||||
/* pointers to the return variables:
|
/* pointers to the return variables:
|
||||||
alng = ecliptic longitude in degrees
|
* alng = ecliptic longitude in degrees
|
||||||
arad = radius vector in AU (astronomic units)
|
* arad = radius vector in AU (astronomic units)
|
||||||
alat = ecliptic latitude in degrees
|
* alat = ecliptic latitude in degrees
|
||||||
alngspeed = speed of planet in degrees per day
|
* alngspeed = speed of planet in degrees per day
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
double tjd = jd_ad + JUL_OFFSET;
|
double tjd = jd_ad + JUL_OFFSET;
|
||||||
@ -329,7 +348,8 @@ int calc(int planet, /* planet index as defined in placalc.h,
|
|||||||
*alng = nut = x[2];
|
*alng = nut = x[2];
|
||||||
*arad = x[1];
|
*arad = x[1];
|
||||||
*alat = ekl = x[0];
|
*alat = ekl = x[0];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
*alng = x[0];
|
*alng = x[0];
|
||||||
*arad = x[2];
|
*arad = x[2];
|
||||||
*alat = x[1];
|
*alat = x[1];
|
||||||
@ -338,7 +358,8 @@ int calc(int planet, /* planet index as defined in placalc.h,
|
|||||||
return (OK);
|
return (OK);
|
||||||
} /* end calc */
|
} /* end calc */
|
||||||
|
|
||||||
int rel_geo(int planet, double rau)
|
int
|
||||||
|
rel_geo(int planet, double rau)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* get relative earth distance in range 0..1000:
|
* get relative earth distance in range 0..1000:
|
||||||
@ -356,8 +377,12 @@ int rel_geo(int planet, double rau)
|
|||||||
int rgeo;
|
int rgeo;
|
||||||
if (planet == MEAN_NODE || planet == TRUE_NODE || planet == LILITH) {
|
if (planet == MEAN_NODE || planet == TRUE_NODE || planet == LILITH) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
}
|
||||||
rgeo = 1000 * (1.0 - (rau - rmima[planet][0]) / (rmima[planet][1] - rmima[planet][0]));
|
else {
|
||||||
|
rgeo =
|
||||||
|
1000 * (1.0 -
|
||||||
|
(rau - rmima[planet][0]) / (rmima[planet][1] -
|
||||||
|
rmima[planet][0]));
|
||||||
}
|
}
|
||||||
if (rgeo < 0)
|
if (rgeo < 0)
|
||||||
rgeo = 0;
|
rgeo = 0;
|
||||||
@ -370,31 +395,74 @@ int rel_geo(int planet, double rau)
|
|||||||
* get the planet index for an AFL letter
|
* get the planet index for an AFL letter
|
||||||
* returns -1 if the letter does not correspond to a planet.
|
* returns -1 if the letter does not correspond to a planet.
|
||||||
*/
|
*/
|
||||||
int afl2planet(int afl)
|
int
|
||||||
|
afl2planet(int afl)
|
||||||
{
|
{
|
||||||
int p;
|
int p;
|
||||||
switch (afl) {
|
switch (afl) {
|
||||||
case AFL_SUN : p = SUN; break;
|
case AFL_SUN:
|
||||||
case AFL_MON : p = MOON; break;
|
p = SUN;
|
||||||
case AFL_MER : p = MERCURY; break;
|
break;
|
||||||
case AFL_VEN : p = VENUS; break;
|
case AFL_MON:
|
||||||
case AFL_MAR : p = MARS; break;
|
p = MOON;
|
||||||
case AFL_JUP : p = JUPITER; break;
|
break;
|
||||||
case AFL_SAT : p = SATURN; break;
|
case AFL_MER:
|
||||||
case AFL_URA : p = URANUS; break;
|
p = MERCURY;
|
||||||
case AFL_NEP : p = NEPTUNE; break;
|
break;
|
||||||
case AFL_PLU : p = PLUTO; break;
|
case AFL_VEN:
|
||||||
case AFL_MNODE : p = MEAN_NODE; break;
|
p = VENUS;
|
||||||
case AFL_TNODE : p = TRUE_NODE; break;
|
break;
|
||||||
case AFL_CHI : p = CHIRON; break;
|
case AFL_MAR:
|
||||||
case AFL_LIL : p = LILITH; break;
|
p = MARS;
|
||||||
case AFL_CER : p = CERES; break;
|
break;
|
||||||
case AFL_PAL : p = PALLAS; break;
|
case AFL_JUP:
|
||||||
case AFL_JUN : p = JUNO; break;
|
p = JUPITER;
|
||||||
case AFL_VES : p = VESTA; break;
|
break;
|
||||||
case AFL_AC : p = AC; break;
|
case AFL_SAT:
|
||||||
case AFL_MC : p = MC; break;
|
p = SATURN;
|
||||||
default : p = -1; break;
|
break;
|
||||||
|
case AFL_URA:
|
||||||
|
p = URANUS;
|
||||||
|
break;
|
||||||
|
case AFL_NEP:
|
||||||
|
p = NEPTUNE;
|
||||||
|
break;
|
||||||
|
case AFL_PLU:
|
||||||
|
p = PLUTO;
|
||||||
|
break;
|
||||||
|
case AFL_MNODE:
|
||||||
|
p = MEAN_NODE;
|
||||||
|
break;
|
||||||
|
case AFL_TNODE:
|
||||||
|
p = TRUE_NODE;
|
||||||
|
break;
|
||||||
|
case AFL_CHI:
|
||||||
|
p = CHIRON;
|
||||||
|
break;
|
||||||
|
case AFL_LIL:
|
||||||
|
p = LILITH;
|
||||||
|
break;
|
||||||
|
case AFL_CER:
|
||||||
|
p = CERES;
|
||||||
|
break;
|
||||||
|
case AFL_PAL:
|
||||||
|
p = PALLAS;
|
||||||
|
break;
|
||||||
|
case AFL_JUN:
|
||||||
|
p = JUNO;
|
||||||
|
break;
|
||||||
|
case AFL_VES:
|
||||||
|
p = VESTA;
|
||||||
|
break;
|
||||||
|
case AFL_AC:
|
||||||
|
p = AC;
|
||||||
|
break;
|
||||||
|
case AFL_MC:
|
||||||
|
p = MC;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
p = -1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -403,29 +471,50 @@ int afl2planet(int afl)
|
|||||||
* get the AFL letter for a planet
|
* get the AFL letter for a planet
|
||||||
* returns -1 if no letter corresponds to a planet.
|
* returns -1 if no letter corresponds to a planet.
|
||||||
*/
|
*/
|
||||||
int planet2afl(int planet)
|
int
|
||||||
|
planet2afl(int planet)
|
||||||
{
|
{
|
||||||
switch (planet) {
|
switch (planet) {
|
||||||
case SUN: return AFL_SUN;
|
case SUN:
|
||||||
case MOON: return AFL_MON;
|
return AFL_SUN;
|
||||||
case MERCURY: return AFL_MER;
|
case MOON:
|
||||||
case VENUS: return AFL_VEN;
|
return AFL_MON;
|
||||||
case MARS: return AFL_MAR;
|
case MERCURY:
|
||||||
case JUPITER: return AFL_JUP;
|
return AFL_MER;
|
||||||
case SATURN: return AFL_SAT;
|
case VENUS:
|
||||||
case URANUS: return AFL_URA;
|
return AFL_VEN;
|
||||||
case NEPTUNE: return AFL_NEP;
|
case MARS:
|
||||||
case PLUTO: return AFL_PLU;
|
return AFL_MAR;
|
||||||
case MEAN_NODE: return AFL_MNODE;
|
case JUPITER:
|
||||||
case TRUE_NODE: return AFL_TNODE;
|
return AFL_JUP;
|
||||||
case CHIRON: return AFL_CHI;
|
case SATURN:
|
||||||
case LILITH: return AFL_LIL;
|
return AFL_SAT;
|
||||||
case CERES: return AFL_CER;
|
case URANUS:
|
||||||
case PALLAS: return AFL_PAL;
|
return AFL_URA;
|
||||||
case JUNO: return AFL_JUN;
|
case NEPTUNE:
|
||||||
case VESTA: return AFL_VES;
|
return AFL_NEP;
|
||||||
case AC: return AFL_AC;
|
case PLUTO:
|
||||||
case MC: return AFL_MC;
|
return AFL_PLU;
|
||||||
|
case MEAN_NODE:
|
||||||
|
return AFL_MNODE;
|
||||||
|
case TRUE_NODE:
|
||||||
|
return AFL_TNODE;
|
||||||
|
case CHIRON:
|
||||||
|
return AFL_CHI;
|
||||||
|
case LILITH:
|
||||||
|
return AFL_LIL;
|
||||||
|
case CERES:
|
||||||
|
return AFL_CER;
|
||||||
|
case PALLAS:
|
||||||
|
return AFL_PAL;
|
||||||
|
case JUNO:
|
||||||
|
return AFL_JUN;
|
||||||
|
case VESTA:
|
||||||
|
return AFL_VES;
|
||||||
|
case AC:
|
||||||
|
return AFL_AC;
|
||||||
|
case MC:
|
||||||
|
return AFL_MC;
|
||||||
}
|
}
|
||||||
if (planet >= FIRST_HSNR && planet <= LAST_HSNR)
|
if (planet >= FIRST_HSNR && planet <= LAST_HSNR)
|
||||||
return AFL_HOUSE;
|
return AFL_HOUSE;
|
||||||
@ -437,29 +526,50 @@ int planet2afl(int planet)
|
|||||||
* get the 2-letter abbreviation for a planet
|
* get the 2-letter abbreviation for a planet
|
||||||
* returns ?? if not defined
|
* returns ?? if not defined
|
||||||
*/
|
*/
|
||||||
char *planet2abbr2(int planet)
|
char *
|
||||||
|
planet2abbr2(int planet)
|
||||||
{
|
{
|
||||||
switch (planet) {
|
switch (planet) {
|
||||||
case SUN: return "su";
|
case SUN:
|
||||||
case MOON: return "mo";
|
return "su";
|
||||||
case MERCURY: return "me";
|
case MOON:
|
||||||
case VENUS: return "ve";
|
return "mo";
|
||||||
case MARS: return "ma";
|
case MERCURY:
|
||||||
case JUPITER: return "ju";
|
return "me";
|
||||||
case SATURN: return "sa";
|
case VENUS:
|
||||||
case URANUS: return "ur";
|
return "ve";
|
||||||
case NEPTUNE: return "ne";
|
case MARS:
|
||||||
case PLUTO: return "pl";
|
return "ma";
|
||||||
case MEAN_NODE: return "mn";
|
case JUPITER:
|
||||||
case TRUE_NODE: return "tn";
|
return "ju";
|
||||||
case CHIRON: return "ch";
|
case SATURN:
|
||||||
case LILITH: return "li";
|
return "sa";
|
||||||
case CERES: return "ce";
|
case URANUS:
|
||||||
case PALLAS: return "pa";
|
return "ur";
|
||||||
case JUNO: return "jn";
|
case NEPTUNE:
|
||||||
case VESTA: return "vs";
|
return "ne";
|
||||||
case AC: return "ac";
|
case PLUTO:
|
||||||
case MC: return "mc";
|
return "pl";
|
||||||
|
case MEAN_NODE:
|
||||||
|
return "mn";
|
||||||
|
case TRUE_NODE:
|
||||||
|
return "tn";
|
||||||
|
case CHIRON:
|
||||||
|
return "ch";
|
||||||
|
case LILITH:
|
||||||
|
return "li";
|
||||||
|
case CERES:
|
||||||
|
return "ce";
|
||||||
|
case PALLAS:
|
||||||
|
return "pa";
|
||||||
|
case JUNO:
|
||||||
|
return "jn";
|
||||||
|
case VESTA:
|
||||||
|
return "vs";
|
||||||
|
case AC:
|
||||||
|
return "ac";
|
||||||
|
case MC:
|
||||||
|
return "mc";
|
||||||
}
|
}
|
||||||
return "??";
|
return "??";
|
||||||
}
|
}
|
||||||
@ -468,39 +578,62 @@ char *planet2abbr2(int planet)
|
|||||||
* get the 3-letter abbreviation for a planet
|
* get the 3-letter abbreviation for a planet
|
||||||
* returns ??? if not defined
|
* returns ??? if not defined
|
||||||
*/
|
*/
|
||||||
char *planet2abbr3(int planet)
|
char *
|
||||||
|
planet2abbr3(int planet)
|
||||||
{
|
{
|
||||||
switch (planet) {
|
switch (planet) {
|
||||||
case SUN: return "sun";
|
case SUN:
|
||||||
case MOON: return "mon";
|
return "sun";
|
||||||
case MERCURY: return "mer";
|
case MOON:
|
||||||
case VENUS: return "ven";
|
return "mon";
|
||||||
case MARS: return "mar";
|
case MERCURY:
|
||||||
case JUPITER: return "jup";
|
return "mer";
|
||||||
case SATURN: return "sat";
|
case VENUS:
|
||||||
case URANUS: return "ura";
|
return "ven";
|
||||||
case NEPTUNE: return "nep";
|
case MARS:
|
||||||
case PLUTO: return "plu";
|
return "mar";
|
||||||
case MEAN_NODE: return "mno";
|
case JUPITER:
|
||||||
case TRUE_NODE: return "tno";
|
return "jup";
|
||||||
case CHIRON: return "chi";
|
case SATURN:
|
||||||
case LILITH: return "lil";
|
return "sat";
|
||||||
case CERES: return "cer";
|
case URANUS:
|
||||||
case PALLAS: return "pal";
|
return "ura";
|
||||||
case JUNO: return "jun";
|
case NEPTUNE:
|
||||||
case VESTA: return "ves";
|
return "nep";
|
||||||
case AC: return "asc";
|
case PLUTO:
|
||||||
case MC: return "mc ";
|
return "plu";
|
||||||
|
case MEAN_NODE:
|
||||||
|
return "mno";
|
||||||
|
case TRUE_NODE:
|
||||||
|
return "tno";
|
||||||
|
case CHIRON:
|
||||||
|
return "chi";
|
||||||
|
case LILITH:
|
||||||
|
return "lil";
|
||||||
|
case CERES:
|
||||||
|
return "cer";
|
||||||
|
case PALLAS:
|
||||||
|
return "pal";
|
||||||
|
case JUNO:
|
||||||
|
return "jun";
|
||||||
|
case VESTA:
|
||||||
|
return "ves";
|
||||||
|
case AC:
|
||||||
|
return "asc";
|
||||||
|
case MC:
|
||||||
|
return "mc ";
|
||||||
}
|
}
|
||||||
return "???";
|
return "???";
|
||||||
}
|
}
|
||||||
|
|
||||||
char *placalc_set_ephepath(char *path)
|
char *
|
||||||
|
placalc_set_ephepath(char *path)
|
||||||
{
|
{
|
||||||
static char *epath;
|
static char *epath;
|
||||||
if (path == NULL) return epath;
|
if (path == NULL)
|
||||||
|
return epath;
|
||||||
if (epath != NULL)
|
if (epath != NULL)
|
||||||
free((void *) epath);
|
free((void *)epath);
|
||||||
epath = malloc(strlen(path) + 1);
|
epath = malloc(strlen(path) + 1);
|
||||||
if (epath != NULL) {
|
if (epath != NULL) {
|
||||||
strcpy(epath, path);
|
strcpy(epath, path);
|
||||||
@ -509,12 +642,14 @@ char *placalc_set_ephepath(char *path)
|
|||||||
return epath;
|
return epath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void placalc_close_files()
|
void
|
||||||
|
placalc_close_files()
|
||||||
{
|
{
|
||||||
swe_close();
|
swe_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
char *placalc_get_errtext()
|
char *
|
||||||
|
placalc_get_errtext()
|
||||||
{
|
{
|
||||||
return perrtx;
|
return perrtx;
|
||||||
}
|
}
|
||||||
@ -524,8 +659,9 @@ deltat(t): returns delta t (in julian days) from universal time t
|
|||||||
is included by users
|
is included by users
|
||||||
ET = UT + deltat
|
ET = UT + deltat
|
||||||
******************************************************/
|
******************************************************/
|
||||||
double deltat (double jd_ad) /* Astrodienst relative julian date */
|
double
|
||||||
{
|
deltat(double jd_ad)
|
||||||
|
{ /* Astrodienst relative julian date */
|
||||||
return swe_deltat(jd_ad + JUL_OFFSET);
|
return swe_deltat(jd_ad + JUL_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -541,32 +677,36 @@ double deltat (double jd_ad) /* Astrodienst relative julian date */
|
|||||||
* lon, lat pointer for returning the ecliptic coordinates
|
* lon, lat pointer for returning the ecliptic coordinates
|
||||||
* (mean ecliptic and equinox of date)
|
* (mean ecliptic and equinox of date)
|
||||||
**********************************************************/
|
**********************************************************/
|
||||||
int fixstar(char *star, double jd, double *lon, double *lat)
|
int
|
||||||
|
fixstar(char *star, double jd, double *lon, double *lat)
|
||||||
{
|
{
|
||||||
double x[6];
|
double x[6];
|
||||||
int i;
|
int i;
|
||||||
int32 retflag;
|
int32 retflag;
|
||||||
/* if call by number, fixstar() is 0-based,
|
/* if call by number, fixstar() is 0-based,
|
||||||
* whereas swe_fixstar starts with 1 */
|
* whereas swe_fixstar starts with 1 */
|
||||||
if (isdigit((int) *star)) {
|
if (isdigit((int)*star)) {
|
||||||
i = atoi(star);
|
i = atoi(star);
|
||||||
sprintf(star, "%d", i+1);
|
sprintf(star, "%d", i + 1);
|
||||||
}
|
}
|
||||||
retflag = swe_fixstar(star, jd, 0, x, perrtx);
|
retflag = swe_fixstar(star, jd, 0, x, perrtx);
|
||||||
*lon = x[0];
|
*lon = x[0];
|
||||||
*lat = x[1];
|
*lat = x[1];
|
||||||
return((int) retflag);
|
return ((int)retflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
double diff8360 (double a, double b)
|
double
|
||||||
/* a - b on a 360 degree circle, result -180..180*/
|
diff8360(double a, double b)
|
||||||
|
/* a - b on a 360 degree circle, result -180..180 */
|
||||||
{
|
{
|
||||||
double d;
|
double d;
|
||||||
d = a - b;
|
d = a - b;
|
||||||
if ( d >= 180.0 ) return( d - 360.0 );
|
if (d >= 180.0)
|
||||||
if ( d < -180.0 ) return( d + 360.0 );
|
return (d - 360.0);
|
||||||
return( d );
|
if (d < -180.0)
|
||||||
|
return (d + 360.0);
|
||||||
|
return (d);
|
||||||
} /* diff8360 */
|
} /* diff8360 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -577,12 +717,14 @@ double diff8360 (double a, double b)
|
|||||||
return in which house pp is;
|
return in which house pp is;
|
||||||
houses are numbered from 1 .. 12
|
houses are numbered from 1 .. 12
|
||||||
*************************************/
|
*************************************/
|
||||||
int HouseNr(struct houses *hsp, CSEC pp)
|
int
|
||||||
|
HouseNr(struct houses *hsp, CSEC pp)
|
||||||
{
|
{
|
||||||
CSEC cx;
|
CSEC cx;
|
||||||
int i = 2;
|
int i = 2;
|
||||||
cx = swe_difcsn(pp, hsp->cusp [1]); /* distance from cusp 1 */
|
cx = swe_difcsn(pp, hsp->cusp[1]); /* distance from cusp 1 */
|
||||||
while (i < 13 && cx >= difcsn(hsp->cusp [i], hsp->cusp [1])) i++;
|
while (i < 13 && cx >= difcsn(hsp->cusp[i], hsp->cusp[1]))
|
||||||
|
i++;
|
||||||
return (i - 1);
|
return (i - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -590,12 +732,15 @@ int HouseNr(struct houses *hsp, CSEC pp)
|
|||||||
returns the inp-house number, where pp is in
|
returns the inp-house number, where pp is in
|
||||||
houses are numbered from 1 .. 12
|
houses are numbered from 1 .. 12
|
||||||
************************************/
|
************************************/
|
||||||
int InpHouseNr (struct houses *hsp, CSEC pp, CSEC *coff)
|
int
|
||||||
|
InpHouseNr(struct houses *hsp, CSEC pp, CSEC * coff)
|
||||||
{
|
{
|
||||||
CSEC cx;
|
CSEC cx;
|
||||||
int i = 2;
|
int i = 2;
|
||||||
cx = swe_difcsn(pp, hsp->cusp [1] + coff [1]);
|
cx = swe_difcsn(pp, hsp->cusp[1] + coff[1]);
|
||||||
while(i<13 && cx >= swe_difcsn(hsp->cusp[i] + coff[i], hsp->cusp[1] + coff[1]))
|
while (i < 13
|
||||||
|
&& cx >= swe_difcsn(hsp->cusp[i] + coff[i],
|
||||||
|
hsp->cusp[1] + coff[1]))
|
||||||
i++;
|
i++;
|
||||||
return (i - 1);
|
return (i - 1);
|
||||||
}
|
}
|
||||||
@ -608,7 +753,8 @@ int InpHouseNr (struct houses *hsp, CSEC pp, CSEC *coff)
|
|||||||
* We first calculate the absolute offsets for each house of our birth chart,
|
* We first calculate the absolute offsets for each house of our birth chart,
|
||||||
* then call the function InpHouseNr() with those values.
|
* then call the function InpHouseNr() with those values.
|
||||||
*/
|
*/
|
||||||
int InpHouseNr2 (struct houses *hsp, CSEC pp, CSEC *coff)
|
int
|
||||||
|
InpHouseNr2(struct houses *hsp, CSEC pp, CSEC * coff)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
CSEC myoff[13];
|
CSEC myoff[13];
|
||||||
@ -617,42 +763,66 @@ int InpHouseNr2 (struct houses *hsp, CSEC pp, CSEC *coff)
|
|||||||
if (myoff[0] == 1) {
|
if (myoff[0] == 1) {
|
||||||
for (i = 1; i < 13; i++) {
|
for (i = 1; i < 13; i++) {
|
||||||
j = i + 1;
|
j = i + 1;
|
||||||
if (j > 12) j = 1;
|
if (j > 12)
|
||||||
myoff[j] = swe_degnorm((hsp->cusp[j] - hsp->cusp[i]) / 360000.0) / 30.0 * myoff[j];
|
j = 1;
|
||||||
|
myoff[j] =
|
||||||
|
swe_degnorm((hsp->cusp[j] -
|
||||||
|
hsp->cusp[i]) / 360000.0) / 30.0 * myoff[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return InpHouseNr(hsp, pp, myoff);
|
return InpHouseNr(hsp, pp, myoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ********************************************************* */
|
/* ********************************************************* */
|
||||||
|
|
||||||
/* Houses: */
|
/* Houses: */
|
||||||
|
|
||||||
/* ********************************************************* */
|
/* ********************************************************* */
|
||||||
|
|
||||||
/* Koch and Placidus don't work in the polar circle. */
|
/* Koch and Placidus don't work in the polar circle. */
|
||||||
|
|
||||||
/* We swap MC/IC so that MC is always before AC in the zodiac */
|
/* We swap MC/IC so that MC is always before AC in the zodiac */
|
||||||
|
|
||||||
/* We than divide the quadrants into 3 equal parts. */
|
/* We than divide the quadrants into 3 equal parts. */
|
||||||
|
|
||||||
/* ********************************************************* */
|
/* ********************************************************* */
|
||||||
|
|
||||||
/* All angles are expressed in centiseconds (1/100th of a */
|
/* All angles are expressed in centiseconds (1/100th of a */
|
||||||
|
|
||||||
/* second of arc) and integer arithmetic is used for these. */
|
/* second of arc) and integer arithmetic is used for these. */
|
||||||
|
|
||||||
/* Special trigonometric functions dsin, dcos etc. are im- */
|
/* Special trigonometric functions dsin, dcos etc. are im- */
|
||||||
|
|
||||||
/* plemented for arguments in centiseconds. */
|
/* plemented for arguments in centiseconds. */
|
||||||
|
|
||||||
/* ********************************************************* */
|
/* ********************************************************* */
|
||||||
|
|
||||||
/* Arguments: th = sidereal time (angle 0..360 degrees */
|
/* Arguments: th = sidereal time (angle 0..360 degrees */
|
||||||
|
|
||||||
/* hsy = letter code for house system; implemen- */
|
/* hsy = letter code for house system; implemen- */
|
||||||
|
|
||||||
/* ted are P,K,C,R,E,V. */
|
/* ted are P,K,C,R,E,V. */
|
||||||
|
|
||||||
/* fi = geographic latitude */
|
/* fi = geographic latitude */
|
||||||
|
|
||||||
/* ekl = obliquity of the ecliptic */
|
/* ekl = obliquity of the ecliptic */
|
||||||
|
|
||||||
/* iteration_count = number of iterations in */
|
/* iteration_count = number of iterations in */
|
||||||
|
|
||||||
/* Placidus calculation; can be 1 or 2. */
|
/* Placidus calculation; can be 1 or 2. */
|
||||||
|
|
||||||
/* ********************************************************* */
|
/* ********************************************************* */
|
||||||
void CalcHouses(CSEC th, CSEC fi, CSEC mekl, char hsy, int iteration_count,
|
void
|
||||||
struct houses *hsp )
|
CalcHouses(CSEC th, CSEC fi, CSEC mekl, char hsy, int iteration_count,
|
||||||
|
struct houses *hsp)
|
||||||
{
|
{
|
||||||
int retc = 0, i;
|
int retc = 0, i;
|
||||||
double cs2deg = 360000;
|
double cs2deg = 360000;
|
||||||
double cusps[13];
|
double cusps[13];
|
||||||
double ascmc[10];
|
double ascmc[10];
|
||||||
/* iteration_count is always 2 */
|
/* iteration_count is always 2 */
|
||||||
retc = swe_houses_armc(th / cs2deg, fi / cs2deg, mekl / cs2deg, (int) hsy,
|
retc =
|
||||||
|
swe_houses_armc(th / cs2deg, fi / cs2deg, mekl / cs2deg, (int)hsy,
|
||||||
cusps, ascmc);
|
cusps, ascmc);
|
||||||
for (i = 0; i < 13; i++)
|
for (i = 0; i < 13; i++)
|
||||||
hsp->cusp[i] = swe_d2l(cusps[i] * cs2deg);
|
hsp->cusp[i] = swe_d2l(cusps[i] * cs2deg);
|
||||||
@ -666,9 +836,10 @@ void CalcHouses(CSEC th, CSEC fi, CSEC mekl, char hsy, int iteration_count,
|
|||||||
} /* procedure houses */
|
} /* procedure houses */
|
||||||
|
|
||||||
/******************************/
|
/******************************/
|
||||||
void RecalcAspects(struct AspectType *a)
|
void
|
||||||
|
RecalcAspects(struct AspectType *a)
|
||||||
{
|
{
|
||||||
centisec diff,orbis;
|
centisec diff, orbis;
|
||||||
int p1, p2, i;
|
int p1, p2, i;
|
||||||
struct aspRec *arp;
|
struct aspRec *arp;
|
||||||
if (a->ppos2 == NULL) { /* no set ppos2, no interaspects */
|
if (a->ppos2 == NULL) { /* no set ppos2, no interaspects */
|
||||||
@ -676,40 +847,41 @@ void RecalcAspects(struct AspectType *a)
|
|||||||
a->Asp[p1][p1].index = 0; /* ignore p1 conjunct p1 */
|
a->Asp[p1][p1].index = 0; /* ignore p1 conjunct p1 */
|
||||||
for (p2 = p1 + 1; p2 < a->NrOfPlanets; p2++) {
|
for (p2 = p1 + 1; p2 < a->NrOfPlanets; p2++) {
|
||||||
arp = &(a->Asp[p1][p2]);
|
arp = &(a->Asp[p1][p2]);
|
||||||
diff = a->PlanetPos [p2] - a->PlanetPos [p1];
|
diff = a->PlanetPos[p2] - a->PlanetPos[p1];
|
||||||
if (diff >= DEG180)
|
if (diff >= DEG180)
|
||||||
diff -= DEG360;
|
diff -= DEG360;
|
||||||
else if (diff < - DEG180)
|
else if (diff < -DEG180)
|
||||||
diff += DEG360;
|
diff += DEG360;
|
||||||
i = 1;
|
i = 1;
|
||||||
arp->index = 0;
|
arp->index = 0;
|
||||||
while (i <= a->NrOfAspects) {
|
while (i <= a->NrOfAspects) {
|
||||||
orbis = ABS4 (diff) - a->Angle [i];
|
orbis = ABS4(diff) - a->Angle[i];
|
||||||
if (ABS4 (orbis) <= a->Maxorb [i]) {
|
if (ABS4(orbis) <= a->Maxorb[i]) {
|
||||||
arp->index = i;
|
arp->index = i;
|
||||||
arp->orb = orbis;
|
arp->orb = orbis;
|
||||||
break; /* out of while */
|
break; /* out of while */
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
a->Asp [p2][p1].index = arp->index;
|
a->Asp[p2][p1].index = arp->index;
|
||||||
a->Asp [p2][p1].orb = arp->orb;
|
a->Asp[p2][p1].orb = arp->orb;
|
||||||
} /* for p2 */
|
} /* for p2 */
|
||||||
} /* for p1 */
|
} /* for p1 */
|
||||||
} else { /* interaspects between set 1 and set 2 */
|
}
|
||||||
|
else { /* interaspects between set 1 and set 2 */
|
||||||
for (p1 = 0; p1 < a->NrOfPlanets; p1++) {
|
for (p1 = 0; p1 < a->NrOfPlanets; p1++) {
|
||||||
for (p2 = 0; p2 < a->NrOfPlanets; p2++) {
|
for (p2 = 0; p2 < a->NrOfPlanets; p2++) {
|
||||||
arp = &(a->Asp[p1][p2]);
|
arp = &(a->Asp[p1][p2]);
|
||||||
diff = a->ppos2 [p2] - a->PlanetPos [p1];
|
diff = a->ppos2[p2] - a->PlanetPos[p1];
|
||||||
if (diff >= DEG180)
|
if (diff >= DEG180)
|
||||||
diff -= DEG360;
|
diff -= DEG360;
|
||||||
else if (diff < - DEG180)
|
else if (diff < -DEG180)
|
||||||
diff += DEG360;
|
diff += DEG360;
|
||||||
i = 1;
|
i = 1;
|
||||||
arp->index = 0;
|
arp->index = 0;
|
||||||
while (i <= a->NrOfAspects) {
|
while (i <= a->NrOfAspects) {
|
||||||
orbis = ABS4 (diff) - a->Angle [i];
|
orbis = ABS4(diff) - a->Angle[i];
|
||||||
if (ABS4 (orbis) <= a->Maxorb [i]) {
|
if (ABS4(orbis) <= a->Maxorb[i]) {
|
||||||
arp->index = i;
|
arp->index = i;
|
||||||
arp->orb = orbis;
|
arp->orb = orbis;
|
||||||
break; /* out of while */
|
break; /* out of while */
|
||||||
@ -727,20 +899,23 @@ function sidtime (t): returns sidereal time at greenwich;
|
|||||||
Parameters differ from ASYS version! after AESuppl. 1961, page 75
|
Parameters differ from ASYS version! after AESuppl. 1961, page 75
|
||||||
version 24-oct-87
|
version 24-oct-87
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
double sidtime (double jd_ad, double ecl, double nuta)
|
double
|
||||||
|
sidtime(double jd_ad, double ecl, double nuta)
|
||||||
/* jd_ad relative julian date */
|
/* jd_ad relative julian date */
|
||||||
/* ecl, nuta ecliptic and nutation of date, in degrees */
|
/* ecl, nuta ecliptic and nutation of date, in degrees */
|
||||||
{
|
{
|
||||||
return swe_sidtime0(jd_ad + JUL_OFFSET, ecl, nuta);
|
return swe_sidtime0(jd_ad + JUL_OFFSET, ecl, nuta);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef INTEL_BYTE_ORDER
|
#ifdef INTEL_BYTE_ORDER
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
void longreorder (UCHAR *p, int n)
|
void
|
||||||
|
longreorder(UCHAR * p, int n)
|
||||||
/* p points to memory filled with int32 values; for
|
/* p points to memory filled with int32 values; for
|
||||||
each of the values the seqeuence of the four bytes
|
* each of the values the seqeuence of the four bytes
|
||||||
has to be reversed, to translate HP-UX and VAX
|
* has to be reversed, to translate HP-UX and VAX
|
||||||
ordering to MSDOS/Turboc ordering */
|
* ordering to MSDOS/Turboc ordering */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned char c0, c1, c2, c3;
|
unsigned char c0, c1, c2, c3;
|
||||||
@ -755,4 +930,4 @@ void longreorder (UCHAR *p, int n)
|
|||||||
*(p + 3) = c0;
|
*(p + 3) = c0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
$Header: /home/dieter/sweph/RCS/swepcalc.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/swepcalc.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
||||||
Definitions and constants for Placalc interface to SwissEph
|
Definitions and constants for Placalc interface to SwissEph
|
||||||
@ -85,14 +86,14 @@
|
|||||||
* If you want to adapt your source code, turn the next TRUE into FALSE
|
* If you want to adapt your source code, turn the next TRUE into FALSE
|
||||||
*/
|
*/
|
||||||
#if TRUE /* replace by if FALSE to deactivate macros */
|
#if TRUE /* replace by if FALSE to deactivate macros */
|
||||||
# define d2l(x) swe_d2l(x)
|
#define d2l(x) swe_d2l(x)
|
||||||
# define difcsn(x,y) swe_difcsn(x,y)
|
#define difcsn(x,y) swe_difcsn(x,y)
|
||||||
# define difcs2n(x,y) swe_difcs2n(x,y)
|
#define difcs2n(x,y) swe_difcs2n(x,y)
|
||||||
# define difdegn(x,y) swe_difdegn(x,y)
|
#define difdegn(x,y) swe_difdegn(x,y)
|
||||||
# define difdeg2n(x,y) swe_difdeg2n(x,y)
|
#define difdeg2n(x,y) swe_difdeg2n(x,y)
|
||||||
# define csnorm(x) swe_csnorm(x)
|
#define csnorm(x) swe_csnorm(x)
|
||||||
# define degnorm(x) swe_degnorm(x)
|
#define degnorm(x) swe_degnorm(x)
|
||||||
# define roundsec(x) swe_csroundsec(x)
|
#define roundsec(x) swe_csroundsec(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
@ -102,19 +103,15 @@
|
|||||||
Astrodienst relative julian days, and jd the use of absolute
|
Astrodienst relative julian days, and jd the use of absolute
|
||||||
julian days.
|
julian days.
|
||||||
*************************************************************/
|
*************************************************************/
|
||||||
extern int nacalc(double jd_ad, centisec *plon, centisec *pspe);
|
extern int nacalc(double jd_ad, centisec * plon, centisec * pspe);
|
||||||
extern int calcserv(int id, double t, int flag, int plalist, char *so);
|
extern int calcserv(int id, double t, int flag, int plalist, char *so);
|
||||||
extern void helup(double jd_ad);
|
extern void helup(double jd_ad);
|
||||||
extern void togeo(double le, double re, double l, double r, double z, double *alg, double *arg);
|
extern void togeo(double le, double re, double l, double r, double z,
|
||||||
extern int calc(int p,
|
double *alg, double *arg);
|
||||||
double jd_ad,
|
extern int calc(int p, double jd_ad, int flag, double *alng, double *arad,
|
||||||
int flag,
|
double *alat, double *alngspeed);
|
||||||
double *alng,
|
|
||||||
double *arad,
|
|
||||||
double *alat,
|
|
||||||
double *alngspeed);
|
|
||||||
extern int rel_geo(int p, double rau);
|
extern int rel_geo(int p, double rau);
|
||||||
extern int hel( int p, /* planet index as defined by placalc.h */
|
extern int hel(int p, /* planet index as defined by placalc.h */
|
||||||
double jd_ad, /* relative juliand date, ephemeris time */
|
double jd_ad, /* relative juliand date, ephemeris time */
|
||||||
/* Now come 6 pointers to return values. */
|
/* Now come 6 pointers to return values. */
|
||||||
double *al, /* longitude in degrees */
|
double *al, /* longitude in degrees */
|
||||||
@ -131,24 +128,25 @@ extern double mod8360(double x);
|
|||||||
extern double diff8360(double x, double y);
|
extern double diff8360(double x, double y);
|
||||||
extern double test_near_zero(double x);
|
extern double test_near_zero(double x);
|
||||||
extern double deltat(double jd_ad);
|
extern double deltat(double jd_ad);
|
||||||
extern void to_mean_ekl (double jd, double xyz[], double lrz[]);
|
extern void to_mean_ekl(double jd, double xyz[], double lrz[]);
|
||||||
extern void placalc_close_files();
|
extern void placalc_close_files();
|
||||||
extern int fixstar(char *star, double jd, double *lon, double *lat);
|
extern int fixstar(char *star, double jd, double *lon, double *lat);
|
||||||
extern char *placalc_get_errtext();
|
extern char *placalc_get_errtext();
|
||||||
extern char *placalc_set_ephepath(char *new_path); /* sets ephepath;
|
extern char *placalc_set_ephepath(char *new_path); /* sets ephepath;
|
||||||
if called with NULL, returns current path */
|
* if called with NULL, returns current path */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* because deltat() required a relative Julian date due to historical reasons,
|
* because deltat() required a relative Julian date due to historical reasons,
|
||||||
* we define a function deltatjd() with absolute Juliand date argument.
|
* we define a function deltatjd() with absolute Juliand date argument.
|
||||||
*/
|
*/
|
||||||
# define deltatjd(x) deltat((x) - JUL_OFFSET)
|
#define deltatjd(x) deltat((x) - JUL_OFFSET)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get the planet index for an AFL letter
|
* get the planet index for an AFL letter
|
||||||
* returns -1 if the letter does not correspond to a planet.
|
* returns -1 if the letter does not correspond to a planet.
|
||||||
*/
|
*/
|
||||||
extern int afl2planet(int afl);
|
extern int afl2planet(int afl);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get the AFL letter for a planet
|
* get the AFL letter for a planet
|
||||||
* returns -1 if planet has no letter.
|
* returns -1 if planet has no letter.
|
||||||
@ -196,7 +194,7 @@ extern char *planet2abbr3(int planet);
|
|||||||
#define VESTA 17
|
#define VESTA 17
|
||||||
|
|
||||||
#define MAXPL_NACALC (LILITH) /* nacalc computes SUN..LILITH */
|
#define MAXPL_NACALC (LILITH) /* nacalc computes SUN..LILITH */
|
||||||
# define PROG_PLANET_OFFSET 50 /* progressed sun */
|
#define PROG_PLANET_OFFSET 50 /* progressed sun */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* houses and axes get also a 'planet' index number, but they
|
* houses and axes get also a 'planet' index number, but they
|
||||||
@ -206,15 +204,16 @@ extern char *planet2abbr3(int planet);
|
|||||||
* Axes and houses cannot be computed with calls to calc(); they must
|
* Axes and houses cannot be computed with calls to calc(); they must
|
||||||
* be computed with the housasp module functions.
|
* be computed with the housasp module functions.
|
||||||
*/
|
*/
|
||||||
# define AC 19
|
#define AC 19
|
||||||
# define ASC 19
|
#define ASC 19
|
||||||
# define MC 20
|
#define MC 20
|
||||||
# define CALC_N_MC 21 /* number of normal natal factors */
|
#define CALC_N_MC 21 /* number of normal natal factors */
|
||||||
|
|
||||||
# define FIRST_HSNR 21
|
#define FIRST_HSNR 21
|
||||||
# define LAST_HSNR 32
|
#define LAST_HSNR 32
|
||||||
# define NO_OF_HOUSES 12
|
#define NO_OF_HOUSES 12
|
||||||
#define MAX_PL_INDEX 32
|
#define MAX_PL_INDEX 32
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* in a bitlist flag each planet is represented by a bit;
|
* in a bitlist flag each planet is represented by a bit;
|
||||||
* all 14 defined planets can be called at once with
|
* all 14 defined planets can be called at once with
|
||||||
@ -231,60 +230,60 @@ extern char *planet2abbr3(int planet);
|
|||||||
* The function planet2afl translates a planext index into the AFL letter.
|
* The function planet2afl translates a planext index into the AFL letter.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# define AFL_SUN '0'
|
#define AFL_SUN '0'
|
||||||
# define AFL_MON '1'
|
#define AFL_MON '1'
|
||||||
# define AFL_MER '2'
|
#define AFL_MER '2'
|
||||||
# define AFL_VEN '3'
|
#define AFL_VEN '3'
|
||||||
# define AFL_MAR '4'
|
#define AFL_MAR '4'
|
||||||
# define AFL_JUP '5'
|
#define AFL_JUP '5'
|
||||||
# define AFL_SAT '6'
|
#define AFL_SAT '6'
|
||||||
# define AFL_URA '7'
|
#define AFL_URA '7'
|
||||||
# define AFL_NEP '8'
|
#define AFL_NEP '8'
|
||||||
# define AFL_PLU '9'
|
#define AFL_PLU '9'
|
||||||
# define AFL_CHI 'c'
|
#define AFL_CHI 'c'
|
||||||
# define AFL_LIL 'i' /* mean Lilith: direction of lunar aphel */
|
#define AFL_LIL 'i' /* mean Lilith: direction of lunar aphel */
|
||||||
# define AFL_AC 'A'
|
#define AFL_AC 'A'
|
||||||
# define AFL_MC 'M'
|
#define AFL_MC 'M'
|
||||||
# define AFL_TNODE 'N' /* TRUE_NODE */
|
#define AFL_TNODE 'N' /* TRUE_NODE */
|
||||||
# define AFL_MNODE 'n' /* MEAN_NODE */
|
#define AFL_MNODE 'n' /* MEAN_NODE */
|
||||||
# define AFL_CER 'C'
|
#define AFL_CER 'C'
|
||||||
# define AFL_PAL 'P'
|
#define AFL_PAL 'P'
|
||||||
# define AFL_JUN 'J'
|
#define AFL_JUN 'J'
|
||||||
# define AFL_VES 'V'
|
#define AFL_VES 'V'
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* other AFL definitions not recognized by afl2planet()
|
* other AFL definitions not recognized by afl2planet()
|
||||||
*/
|
*/
|
||||||
# define AFL_SIDT 's' /* sidereal time */
|
#define AFL_SIDT 's' /* sidereal time */
|
||||||
# define AFL_WDAY 'd' /* day of week column */
|
#define AFL_WDAY 'd' /* day of week column */
|
||||||
# define AFL_HOUSE 'H' /* any house cusp */
|
#define AFL_HOUSE 'H' /* any house cusp */
|
||||||
|
|
||||||
# define apl2planet afl2planet /* change of original name */
|
#define apl2planet afl2planet /* change of original name */
|
||||||
|
|
||||||
|
|
||||||
# define J2000 2451545.0 /* Epoch of JPL ephemeris DE200, absolute */
|
#define J2000 2451545.0 /* Epoch of JPL ephemeris DE200, absolute */
|
||||||
# define J1950 2433282.423 /* Epoch of JPL ephemeris DE102 */
|
#define J1950 2433282.423 /* Epoch of JPL ephemeris DE102 */
|
||||||
# define JUL_OFFSET 2433282.0 /* offset of Astrodienst relative Julian date */
|
#define JUL_OFFSET 2433282.0 /* offset of Astrodienst relative Julian date */
|
||||||
|
|
||||||
#ifndef GREG_CAL
|
#ifndef GREG_CAL
|
||||||
# define GREG_CAL SE_GREG_CAL
|
#define GREG_CAL SE_GREG_CAL
|
||||||
# define JUL_CAL SE_JUL_CAL
|
#define JUL_CAL SE_JUL_CAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flag bits used in calc and calcserv
|
* flag bits used in calc and calcserv
|
||||||
*/
|
*/
|
||||||
# define CALC_BIT_HELIO 1 /* geo/helio */
|
#define CALC_BIT_HELIO 1 /* geo/helio */
|
||||||
# define CALC_BIT_NOAPP 2 /* apparent/true positions */
|
#define CALC_BIT_NOAPP 2 /* apparent/true positions */
|
||||||
# define CALC_BIT_NONUT 4 /* true eq. of date/ mean equ. of date */
|
#define CALC_BIT_NONUT 4 /* true eq. of date/ mean equ. of date */
|
||||||
# define CALC_BIT_EPHE 8 /* universal/ephemeris time */
|
#define CALC_BIT_EPHE 8 /* universal/ephemeris time */
|
||||||
# define CALC_BIT_SPEED 16 /* without/with speed */
|
#define CALC_BIT_SPEED 16 /* without/with speed */
|
||||||
# define CALC_BIT_BETA 32 /* without/with latitude */
|
#define CALC_BIT_BETA 32 /* without/with latitude */
|
||||||
# define CALC_BIT_RGEO 64 /* without/with relative rgeo */
|
#define CALC_BIT_RGEO 64 /* without/with relative rgeo */
|
||||||
# define CALC_BIT_RAU 128 /* without/with real radius */
|
#define CALC_BIT_RAU 128 /* without/with real radius */
|
||||||
# define CALC_BIT_MUST_USE_EPHE 256 /* epheserv may not use calc */
|
#define CALC_BIT_MUST_USE_EPHE 256 /* epheserv may not use calc */
|
||||||
# define CALC_BIT_MAY_USE_EPHE 512 /* calcserv may use ephread */
|
#define CALC_BIT_MAY_USE_EPHE 512 /* calcserv may use ephread */
|
||||||
# define CALC_BIT_MUST_CALC 1024 /* ephread must calc */
|
#define CALC_BIT_MUST_CALC 1024 /* ephread must calc */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -292,19 +291,19 @@ extern char *planet2abbr3(int planet);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ADATE /* this must be bracketed because users of swepcalc
|
#ifndef ADATE /* this must be bracketed because users of swepcalc
|
||||||
may also include astrolib.h for other reasons */
|
* may also include astrolib.h for other reasons */
|
||||||
#define ADATE struct adate
|
#define ADATE struct adate
|
||||||
|
|
||||||
/* makros for bit operations */
|
/* makros for bit operations */
|
||||||
# define clear_bit(v,bit_nr) ((v) & ~(1L << (bit_nr)))
|
#define clear_bit(v,bit_nr) ((v) & ~(1L << (bit_nr)))
|
||||||
# define set_bit(v,bit_nr) ((v) | (1L << (bit_nr)))
|
#define set_bit(v,bit_nr) ((v) | (1L << (bit_nr)))
|
||||||
# define bit(bit_nr) (1L << (bit_nr))
|
#define bit(bit_nr) (1L << (bit_nr))
|
||||||
# define check_bit(v,bit_nr) ((v) & (1L << (bit_nr)))
|
#define check_bit(v,bit_nr) ((v) & (1L << (bit_nr)))
|
||||||
|
|
||||||
ADATE { /* date structure used by revjuls and juldays */
|
ADATE { /* date structure used by revjuls and juldays */
|
||||||
int day, month, year;
|
int day, month, year;
|
||||||
centisec csec;
|
centisec csec;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ADATE */
|
#endif /* ADATE */
|
||||||
|
|
||||||
@ -312,11 +311,12 @@ ADATE { /* date structure used by revjuls and juldays */
|
|||||||
* functions exported by swepdate.c
|
* functions exported by swepdate.c
|
||||||
*/
|
*/
|
||||||
extern double julday(int month, int day, int year, double hour, int gregflag);
|
extern double julday(int month, int day, int year, double hour, int gregflag);
|
||||||
extern double juldays(int gregflag, ADATE *adp);
|
extern double juldays(int gregflag, ADATE * adp);
|
||||||
extern void revjul (double u, int gregflag,
|
extern void revjul(double u, int gregflag, int *jmon, int *jday, int *jyear,
|
||||||
int *jmon, int *jday, int *jyear, double *jut);
|
double *jut);
|
||||||
extern void revjuls(double u, int gregflag, ADATE *adp);
|
extern void revjuls(double u, int gregflag, ADATE * adp);
|
||||||
extern int day_of_week(double t);
|
extern int day_of_week(double t);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* end swpdate.c
|
* end swpdate.c
|
||||||
*/
|
*/
|
||||||
@ -333,40 +333,40 @@ extern int day_of_week(double t);
|
|||||||
* We define three different names for the aspects:
|
* We define three different names for the aspects:
|
||||||
* ASP_CONJ (always 4 letters), ASP_0 and CONJ.
|
* ASP_CONJ (always 4 letters), ASP_0 and CONJ.
|
||||||
*/
|
*/
|
||||||
# define ASP_CONJ 1
|
#define ASP_CONJ 1
|
||||||
# define ASP_0 1
|
#define ASP_0 1
|
||||||
# define ASP_OPPO 2
|
#define ASP_OPPO 2
|
||||||
# define ASP_180 2
|
#define ASP_180 2
|
||||||
# define ASP_SQUA 3
|
#define ASP_SQUA 3
|
||||||
# define ASP_90 3
|
#define ASP_90 3
|
||||||
# define ASP_TRIN 4
|
#define ASP_TRIN 4
|
||||||
# define ASP_120 4
|
#define ASP_120 4
|
||||||
# define ASP_SEXT 5
|
#define ASP_SEXT 5
|
||||||
# define ASP_60 5
|
#define ASP_60 5
|
||||||
# define ASP_SMSX 6
|
#define ASP_SMSX 6
|
||||||
# define ASP_30 6
|
#define ASP_30 6
|
||||||
# define ASP_QCNX 7
|
#define ASP_QCNX 7
|
||||||
# define ASP_150 7
|
#define ASP_150 7
|
||||||
# define ASP_SMSQ 8
|
#define ASP_SMSQ 8
|
||||||
# define ASP_45 8
|
#define ASP_45 8
|
||||||
# define ASP_SQSQ 9
|
#define ASP_SQSQ 9
|
||||||
# define ASP_135 9
|
#define ASP_135 9
|
||||||
# define ASP_QINT 10
|
#define ASP_QINT 10
|
||||||
# define ASP_72 10
|
#define ASP_72 10
|
||||||
# define ASP_BQIN 11
|
#define ASP_BQIN 11
|
||||||
# define ASP_144 11
|
#define ASP_144 11
|
||||||
|
|
||||||
# define CONJ ASP_CONJ
|
#define CONJ ASP_CONJ
|
||||||
# define OPPO ASP_OPPO
|
#define OPPO ASP_OPPO
|
||||||
# define SQUA ASP_SQUA
|
#define SQUA ASP_SQUA
|
||||||
# define TRIN ASP_TRIN
|
#define TRIN ASP_TRIN
|
||||||
# define SEXT ASP_SEXT
|
#define SEXT ASP_SEXT
|
||||||
# define SMSX ASP_SMSX
|
#define SMSX ASP_SMSX
|
||||||
# define QCNX ASP_QCNX
|
#define QCNX ASP_QCNX
|
||||||
# define SMSQ ASP_SMSQ
|
#define SMSQ ASP_SMSQ
|
||||||
# define SQSQ ASP_SQSQ
|
#define SQSQ ASP_SQSQ
|
||||||
# define QINT ASP_QINT
|
#define QINT ASP_QINT
|
||||||
# define BQIN ASP_BQIN
|
#define BQIN ASP_BQIN
|
||||||
|
|
||||||
#define MAXASPECTS ASP_BQIN
|
#define MAXASPECTS ASP_BQIN
|
||||||
|
|
||||||
@ -394,60 +394,63 @@ extern int day_of_week(double t);
|
|||||||
/*
|
/*
|
||||||
* used to initialize an array centisec angles[MAXASPECTS+1]
|
* used to initialize an array centisec angles[MAXASPECTS+1]
|
||||||
*/
|
*/
|
||||||
# define ASP_ANGLES {0, 0*DEG, 180*DEG, 90*DEG, 120*DEG,\
|
#define ASP_ANGLES {0, 0*DEG, 180*DEG, 90*DEG, 120*DEG,\
|
||||||
60*DEG, 30*DEG, 150*DEG, 45*DEG, 135*DEG, 72*DEG, 144*DEG}
|
60*DEG, 30*DEG, 150*DEG, 45*DEG, 135*DEG, 72*DEG, 144*DEG}
|
||||||
|
|
||||||
struct AspectType {
|
struct AspectType
|
||||||
|
{
|
||||||
AS_BOOL dataValid; /* used as boolean */
|
AS_BOOL dataValid; /* used as boolean */
|
||||||
int NrOfPlanets,
|
int NrOfPlanets, NrOfAspects;
|
||||||
NrOfAspects;
|
|
||||||
centisec *PlanetPos; /* pointer to an array of planet positions
|
centisec *PlanetPos; /* pointer to an array of planet positions
|
||||||
[0..NrOfPlanets-1]; the user of the
|
* [0..NrOfPlanets-1]; the user of the
|
||||||
structure must set this pointer to his
|
* structure must set this pointer to his
|
||||||
array of planet positions */
|
* array of planet positions */
|
||||||
centisec *ppos2; /* second set for mutual aspects only; if
|
centisec *ppos2; /* second set for mutual aspects only; if
|
||||||
not NULL, interaspects are calculated */
|
* not NULL, interaspects are calculated */
|
||||||
centisec *Maxorb; /* pointer to an array [0..NrOfAspects] of
|
centisec *Maxorb; /* pointer to an array [0..NrOfAspects] of
|
||||||
maximum orbes; element[0] not used;
|
* maximum orbes; element[0] not used;
|
||||||
the user of the structure must set this
|
* the user of the structure must set this
|
||||||
pointer to his array of maxorbs */
|
* pointer to his array of maxorbs */
|
||||||
centisec *Angle; /* pointer to Angle[0..NrOfAspects] of the
|
centisec *Angle; /* pointer to Angle[0..NrOfAspects] of the
|
||||||
angles of aspects; [0] not used; the
|
* angles of aspects; [0] not used; the
|
||||||
user must set this pointer to his array
|
* user must set this pointer to his array
|
||||||
of angles */
|
* of angles */
|
||||||
struct aspRec {
|
struct aspRec
|
||||||
|
{
|
||||||
int index; /* number of the found aspect */
|
int index; /* number of the found aspect */
|
||||||
centisec orb;
|
centisec orb;
|
||||||
}
|
}
|
||||||
Asp [MAXPLANETS] [MAXPLANETS];
|
Asp[MAXPLANETS][MAXPLANETS];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct houses {
|
struct houses
|
||||||
|
{
|
||||||
centisec cusp[13];
|
centisec cusp[13];
|
||||||
centisec ac;
|
centisec ac;
|
||||||
centisec mc;
|
centisec mc;
|
||||||
};
|
};
|
||||||
|
|
||||||
# define HOUSES struct houses
|
#define HOUSES struct houses
|
||||||
#endif /* ifndef ASP_144 */
|
#endif /* ifndef ASP_144 */
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
functions exported originally from housasp.c
|
functions exported originally from housasp.c
|
||||||
***********************************/
|
***********************************/
|
||||||
|
|
||||||
extern int HouseNr(HOUSES *h, CSEC p);
|
extern int HouseNr(HOUSES * h, CSEC p);
|
||||||
/*
|
/*
|
||||||
return in which house pp is,
|
* return in which house pp is,
|
||||||
The caller is responsible for proper initialization of cusps
|
* The caller is responsible for proper initialization of cusps
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int InpHouseNr(HOUSES *h, CSEC p, CSEC *cuspoff);
|
extern int InpHouseNr(HOUSES * h, CSEC p, CSEC * cuspoff);
|
||||||
/* returns the interpretation-house number, where pp is in;
|
/* returns the interpretation-house number, where pp is in;
|
||||||
* an interpretation house is defined differently from a normal
|
* an interpretation house is defined differently from a normal
|
||||||
* house: the cusps are offset, so that it begins and ends
|
* house: the cusps are offset, so that it begins and ends
|
||||||
* a little earlier.
|
* a little earlier.
|
||||||
* cusp[1..12] and cuspoff[1..12] must be initialized
|
* cusp[1..12] and cuspoff[1..12] must be initialized
|
||||||
*/
|
*/
|
||||||
extern int InpHouseNr2(HOUSES *h, CSEC p, CSEC *cuspoff);
|
extern int InpHouseNr2(HOUSES * h, CSEC p, CSEC * cuspoff);
|
||||||
/* variation of InpHouseNr(). Comment in swepcalc.c */
|
/* variation of InpHouseNr(). Comment in swepcalc.c */
|
||||||
|
|
||||||
extern void CalcHouses(CSEC th, CSEC fi, CSEC ekl, char hsy, int icnt,
|
extern void CalcHouses(CSEC th, CSEC fi, CSEC ekl, char hsy, int icnt,
|
||||||
@ -455,7 +458,7 @@ extern void CalcHouses(CSEC th, CSEC fi, CSEC ekl, char hsy, int icnt,
|
|||||||
|
|
||||||
extern void RecalcAspects(struct AspectType *a);
|
extern void RecalcAspects(struct AspectType *a);
|
||||||
|
|
||||||
extern void longreorder (UCHAR *p, int n);
|
extern void longreorder(UCHAR * p, int n);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _SWEPCALC_INCLUDED */
|
#endif /* _SWEPCALC_INCLUDED */
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
$Header: swepdate.c,v 1.65 2003/06/14 13:02:01 alois Exp $
|
$Header: swepdate.c,v 1.65 2003/06/14 13:02:01 alois Exp $
|
||||||
Placalc compatibility interface for Swiss Ephemeris.
|
Placalc compatibility interface for Swiss Ephemeris.
|
||||||
date functions
|
date functions
|
||||||
|
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -129,7 +131,8 @@ date functions
|
|||||||
and notifies errors like 32 January.
|
and notifies errors like 32 January.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
double julday(int month, int day, int year, double hour, int gregflag)
|
double
|
||||||
|
julday(int month, int day, int year, double hour, int gregflag)
|
||||||
{
|
{
|
||||||
double jd;
|
double jd;
|
||||||
jd = swe_julday(year, month, day, hour, gregflag);
|
jd = swe_julday(year, month, day, hour, gregflag);
|
||||||
@ -139,18 +142,21 @@ double julday(int month, int day, int year, double hour, int gregflag)
|
|||||||
/*
|
/*
|
||||||
* monday = 0, ... sunday = 6
|
* monday = 0, ... sunday = 6
|
||||||
*/
|
*/
|
||||||
int day_of_week(double jd)
|
int
|
||||||
|
day_of_week(double jd)
|
||||||
{
|
{
|
||||||
return (((int) floor (jd - 2433282 - 1.5) %7) + 7) % 7;
|
return (((int)floor(jd - 2433282 - 1.5) % 7) + 7) % 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************** julday ******************
|
/*************** julday ******************
|
||||||
get absolute julian day number (author: Marc Pottenger)
|
get absolute julian day number (author: Marc Pottenger)
|
||||||
with bug fix for year < -4711 15-aug-88
|
with bug fix for year < -4711 15-aug-88
|
||||||
*/
|
*/
|
||||||
double juldays(int gregflag, ADATE *adp )
|
double
|
||||||
|
juldays(int gregflag, ADATE * adp)
|
||||||
{
|
{
|
||||||
return swe_julday(adp->year, adp->month, adp->day, adp->csec / 360000.0, gregflag);
|
return swe_julday(adp->year, adp->month, adp->day, adp->csec / 360000.0,
|
||||||
|
gregflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** revjul ******************************************************
|
/*** revjul ******************************************************
|
||||||
@ -172,8 +178,8 @@ double juldays(int gregflag, ADATE *adp )
|
|||||||
Original author Mark Pottenger, Los Angeles.
|
Original author Mark Pottenger, Los Angeles.
|
||||||
with bug fix for year < -4711 16-aug-88 Alois Treindl
|
with bug fix for year < -4711 16-aug-88 Alois Treindl
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void revjul (double jd, int gregflag,
|
void
|
||||||
int *jmon, int *jday, int *jyear, double *jut)
|
revjul(double jd, int gregflag, int *jmon, int *jday, int *jyear, double *jut)
|
||||||
{
|
{
|
||||||
swe_revjul(jd, gregflag, jyear, jmon, jday, jut);
|
swe_revjul(jd, gregflag, jyear, jmon, jday, jut);
|
||||||
}
|
}
|
||||||
@ -183,7 +189,8 @@ void revjul (double jd, int gregflag,
|
|||||||
with bug fix for year < -4711 16-aug-88
|
with bug fix for year < -4711 16-aug-88
|
||||||
arguments are julian day #, calendar flag (0=julian, 1=gregorian)
|
arguments are julian day #, calendar flag (0=julian, 1=gregorian)
|
||||||
*/
|
*/
|
||||||
void revjuls(double jd, int gregflag, struct adate *adp)
|
void
|
||||||
|
revjuls(double jd, int gregflag, struct adate *adp)
|
||||||
{
|
{
|
||||||
double jut;
|
double jut;
|
||||||
swe_revjul(jd, gregflag, &adp->year, &adp->month, &adp->day, &jut);
|
swe_revjul(jd, gregflag, &adp->year, &adp->month, &adp->day, &jut);
|
||||||
@ -215,9 +222,8 @@ void revjuls(double jd, int gregflag, struct adate *adp)
|
|||||||
Return: OK or ERR (for illegal date)
|
Return: OK or ERR (for illegal date)
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
|
|
||||||
int date_conversion (int d ,
|
int
|
||||||
int m ,
|
date_conversion(int d, int m, int y, /* day, month, year */
|
||||||
int y , /* day, month, year */
|
|
||||||
centisec gutime, /* greenwich time in centiseconds */
|
centisec gutime, /* greenwich time in centiseconds */
|
||||||
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
||||||
double *tgmt
|
double *tgmt
|
||||||
@ -236,7 +242,8 @@ int date_conversion (int d ,
|
|||||||
*tgmt = jd - JUL_OFFSET;
|
*tgmt = jd - JUL_OFFSET;
|
||||||
if (rmon == m && rday == d && ryear == y) {
|
if (rmon == m && rday == d && ryear == y) {
|
||||||
return OK;
|
return OK;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
} /* end date_conversion */
|
} /* end date_conversion */
|
||||||
|
2501
swe/src/sweph.c
2501
swe/src/sweph.c
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@
|
|||||||
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -191,9 +192,9 @@
|
|||||||
#define SEI_FILE_FIXSTAR 4
|
#define SEI_FILE_FIXSTAR 4
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define SEI_FILE_TEST_ENDIAN (97L * 65536L + 98L * 256L + 99L) /*abc*/
|
#define SEI_FILE_TEST_ENDIAN (97L * 65536L + 98L * 256L + 99L) /*abc */
|
||||||
#endif
|
#endif
|
||||||
#define SEI_FILE_TEST_ENDIAN (0x616263L) /* abc*/
|
#define SEI_FILE_TEST_ENDIAN (0x616263L) /* abc */
|
||||||
#define SEI_FILE_BIGENDIAN 0
|
#define SEI_FILE_BIGENDIAN 0
|
||||||
#define SEI_FILE_NOREORD 0
|
#define SEI_FILE_NOREORD 0
|
||||||
#define SEI_FILE_LITENDIAN 1
|
#define SEI_FILE_LITENDIAN 1
|
||||||
@ -226,8 +227,9 @@
|
|||||||
#define MOSHPLEPH_END 2818000.5
|
#define MOSHPLEPH_END 2818000.5
|
||||||
#define MOSHLUEPH_START 625000.5
|
#define MOSHLUEPH_START 625000.5
|
||||||
#define MOSHLUEPH_END 2818000.5
|
#define MOSHLUEPH_END 2818000.5
|
||||||
#define MOSHNDEPH_START -254900.5 /* 14 Feb -5410 00:00 ET jul.cal.*/
|
#define MOSHNDEPH_START -254900.5 /* 14 Feb -5410 00:00 ET jul.cal. */
|
||||||
#define MOSHNDEPH_END 3697000.5 /* 11 Dec 5409 00:00 ET, greg. cal */
|
#define MOSHNDEPH_END 3697000.5 /* 11 Dec 5409 00:00 ET, greg. cal */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define MOSHPLEPH_START -225000.5
|
#define MOSHPLEPH_START -225000.5
|
||||||
#define MOSHPLEPH_END 3600000.5
|
#define MOSHPLEPH_END 3600000.5
|
||||||
@ -261,6 +263,7 @@
|
|||||||
#define MOON_MEAN_DIST 384400000.0 /* in m, AA 1996, F2 */
|
#define MOON_MEAN_DIST 384400000.0 /* in m, AA 1996, F2 */
|
||||||
#define MOON_MEAN_INCL 5.1453964 /* AA 1996, D2 */
|
#define MOON_MEAN_INCL 5.1453964 /* AA 1996, D2 */
|
||||||
#define MOON_MEAN_ECC 0.054900489 /* AA 1996, F2 */
|
#define MOON_MEAN_ECC 0.054900489 /* AA 1996, F2 */
|
||||||
|
|
||||||
/* #define SUN_EARTH_MRAT 328900.561400 Su/(Ea+Mo) AA 2006 K7 */
|
/* #define SUN_EARTH_MRAT 328900.561400 Su/(Ea+Mo) AA 2006 K7 */
|
||||||
#define SUN_EARTH_MRAT 332946.050895 /* Su / (Ea only) AA 2006 K7 */
|
#define SUN_EARTH_MRAT 332946.050895 /* Su / (Ea only) AA 2006 K7 */
|
||||||
#define EARTH_MOON_MRAT (1 / 0.0123000383) /* AA 2006, K7 */
|
#define EARTH_MOON_MRAT (1 / 0.0123000383) /* AA 2006, K7 */
|
||||||
@ -277,6 +280,7 @@
|
|||||||
#define KGAUSS 0.01720209895 /* Gaussian gravitational constant K6 */
|
#define KGAUSS 0.01720209895 /* Gaussian gravitational constant K6 */
|
||||||
#define SUN_RADIUS (959.63 / 3600 * DEGTORAD) /* Meeus germ. p 391 */
|
#define SUN_RADIUS (959.63 / 3600 * DEGTORAD) /* Meeus germ. p 391 */
|
||||||
#define EARTH_RADIUS 6378136.6 /* AA 2006 K6 */
|
#define EARTH_RADIUS 6378136.6 /* AA 2006 K6 */
|
||||||
|
|
||||||
/*#define EARTH_OBLATENESS (1.0/ 298.257223563) * AA 1998 K13 */
|
/*#define EARTH_OBLATENESS (1.0/ 298.257223563) * AA 1998 K13 */
|
||||||
#define EARTH_OBLATENESS (1.0/ 298.25642) /* AA 2006 K6 */
|
#define EARTH_OBLATENESS (1.0/ 298.25642) /* AA 2006 K6 */
|
||||||
#define EARTH_ROT_SPEED (7.2921151467e-5 * 86400) /* in rad/day, expl. suppl., p 162 */
|
#define EARTH_ROT_SPEED (7.2921151467e-5 * 86400) /* in rad/day, expl. suppl., p 162 */
|
||||||
@ -285,8 +289,10 @@
|
|||||||
|
|
||||||
/* node of ecliptic measured on ecliptic 2000 */
|
/* node of ecliptic measured on ecliptic 2000 */
|
||||||
#define SSY_PLANE_NODE_E2000 (107.582569 * DEGTORAD)
|
#define SSY_PLANE_NODE_E2000 (107.582569 * DEGTORAD)
|
||||||
|
|
||||||
/* node of ecliptic measured on solar system rotation plane */
|
/* node of ecliptic measured on solar system rotation plane */
|
||||||
#define SSY_PLANE_NODE (107.58883388 * DEGTORAD)
|
#define SSY_PLANE_NODE (107.58883388 * DEGTORAD)
|
||||||
|
|
||||||
/* inclination of ecliptic against solar system rotation plane */
|
/* inclination of ecliptic against solar system rotation plane */
|
||||||
#define SSY_PLANE_INCL (1.578701 * DEGTORAD)
|
#define SSY_PLANE_INCL (1.578701 * DEGTORAD)
|
||||||
|
|
||||||
@ -308,7 +314,7 @@
|
|||||||
|
|
||||||
/* planetary radii in meters */
|
/* planetary radii in meters */
|
||||||
#define NDIAM (SE_VESTA + 1)
|
#define NDIAM (SE_VESTA + 1)
|
||||||
static const double pla_diam[NDIAM] = {1392000000.0, /* Sun */
|
static const double pla_diam[NDIAM] = { 1392000000.0, /* Sun */
|
||||||
3476300.0, /* Moon */
|
3476300.0, /* Moon */
|
||||||
2439000.0 * 2, /* Mercury */
|
2439000.0 * 2, /* Mercury */
|
||||||
6052000.0 * 2, /* Venus */
|
6052000.0 * 2, /* Venus */
|
||||||
@ -326,7 +332,7 @@ static const double pla_diam[NDIAM] = {1392000000.0, /* Sun */
|
|||||||
523000.0, /* Pallas */
|
523000.0, /* Pallas */
|
||||||
244000.0, /* Juno */
|
244000.0, /* Juno */
|
||||||
501000.0, /* Vesta */
|
501000.0, /* Vesta */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Ayanamsas
|
/* Ayanamsas
|
||||||
@ -334,7 +340,10 @@ static const double pla_diam[NDIAM] = {1392000000.0, /* Sun */
|
|||||||
* t0 epoch of ayanamsa, TDT (ET)
|
* t0 epoch of ayanamsa, TDT (ET)
|
||||||
* ayan_t0 ayanamsa value at epoch
|
* ayan_t0 ayanamsa value at epoch
|
||||||
*/
|
*/
|
||||||
struct aya_init {double t0, ayan_t0;};
|
struct aya_init
|
||||||
|
{
|
||||||
|
double t0, ayan_t0;
|
||||||
|
};
|
||||||
static const struct aya_init ayanamsa[] = {
|
static const struct aya_init ayanamsa[] = {
|
||||||
{2433282.5, 24.042044444}, /* 0: Fagan/Bradley (Default) */
|
{2433282.5, 24.042044444}, /* 0: Fagan/Bradley (Default) */
|
||||||
/*{J1900, 360 - 337.53953}, * 1: Lahiri (Robert Hand) */
|
/*{J1900, 360 - 337.53953}, * 1: Lahiri (Robert Hand) */
|
||||||
@ -364,27 +373,28 @@ static const struct aya_init ayanamsa[] = {
|
|||||||
{J1900, 0}, /*19: J1900 */
|
{J1900, 0}, /*19: J1900 */
|
||||||
{B1950, 0}, /*20: B1950 */
|
{B1950, 0}, /*20: B1950 */
|
||||||
{1903396.8128654, 0}, /*21: Suryasiddhanta, assuming
|
{1903396.8128654, 0}, /*21: Suryasiddhanta, assuming
|
||||||
ingress of mean Sun into Aries at point
|
* ingress of mean Sun into Aries at point
|
||||||
of mean equinox of date on
|
* of mean equinox of date on
|
||||||
21.3.499, noon, Ujjain (75.7684565 E)
|
* 21.3.499, noon, Ujjain (75.7684565 E)
|
||||||
= 7:30:31.57 UT */
|
* = 7:30:31.57 UT */
|
||||||
{1903396.8128654,-0.21463395},/*22: Suryasiddhanta, assuming
|
{1903396.8128654, -0.21463395}, /*22: Suryasiddhanta, assuming
|
||||||
ingress of mean Sun into Aries at
|
* ingress of mean Sun into Aries at
|
||||||
true position of mean Sun at same epoch */
|
* true position of mean Sun at same epoch */
|
||||||
{1903396.7895321, 0}, /*23: Aryabhata, same date, but UT 6:56:55.57
|
{1903396.7895321, 0}, /*23: Aryabhata, same date, but UT 6:56:55.57
|
||||||
analogous 21 */
|
* analogous 21 */
|
||||||
{1903396.7895321,-0.23763238},/*24: Aryabhata, analogous 22 */
|
{1903396.7895321, -0.23763238}, /*24: Aryabhata, analogous 22 */
|
||||||
{0, 0}, /*25: - */
|
{0, 0}, /*25: - */
|
||||||
{0, 0}, /*26: - */
|
{0, 0}, /*26: - */
|
||||||
{0, 0}, /*27: - */
|
{0, 0}, /*27: - */
|
||||||
{0, 0}, /*28: - */
|
{0, 0}, /*28: - */
|
||||||
{0, 0}, /*29: - */
|
{0, 0}, /*29: - */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PLAN_DATA struct plan_data
|
#define PLAN_DATA struct plan_data
|
||||||
|
|
||||||
/* obliquity of ecliptic */
|
/* obliquity of ecliptic */
|
||||||
struct epsilon {
|
struct epsilon
|
||||||
|
{
|
||||||
double teps, eps, seps, ceps; /* jd, eps, sin(eps), cos(eps) */
|
double teps, eps, seps, ceps; /* jd, eps, sin(eps), cos(eps) */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -393,7 +403,8 @@ extern struct epsilon oec2000;
|
|||||||
extern struct epsilon oec;
|
extern struct epsilon oec;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct plan_data {
|
struct plan_data
|
||||||
|
{
|
||||||
/* the following data are read from file only once, immediately after
|
/* the following data are read from file only once, immediately after
|
||||||
* file has been opened */
|
* file has been opened */
|
||||||
int ibdy; /* internal body number */
|
int ibdy; /* internal body number */
|
||||||
@ -403,7 +414,7 @@ struct plan_data {
|
|||||||
* to coordinate system of orbital plane
|
* to coordinate system of orbital plane
|
||||||
* SEI_FLG_ELLIPSE: TRUE if reference ellipse */
|
* SEI_FLG_ELLIPSE: TRUE if reference ellipse */
|
||||||
int ncoe; /* # of coefficients of ephemeris polynomial,
|
int ncoe; /* # of coefficients of ephemeris polynomial,
|
||||||
is polynomial order + 1 */
|
* is polynomial order + 1 */
|
||||||
/* where is the segment index on the file */
|
/* where is the segment index on the file */
|
||||||
int32 lndx0; /* file position of begin of planet's index */
|
int32 lndx0; /* file position of begin of planet's index */
|
||||||
int32 nndx; /* number of index entries on file: computed */
|
int32 nndx; /* number of index entries on file: computed */
|
||||||
@ -451,25 +462,29 @@ struct plan_data {
|
|||||||
/* moon, s. moshmoon.c */
|
/* moon, s. moshmoon.c */
|
||||||
extern int swi_mean_node(double jd, double *x, char *serr);
|
extern int swi_mean_node(double jd, double *x, char *serr);
|
||||||
extern int swi_mean_apog(double jd, double *x, char *serr);
|
extern int swi_mean_apog(double jd, double *x, char *serr);
|
||||||
extern int swi_moshmoon(double tjd, AS_BOOL do_save, double *xpm, char *serr) ;
|
extern int swi_moshmoon(double tjd, AS_BOOL do_save, double *xpm, char *serr);
|
||||||
extern int swi_moshmoon2(double jd, double *x);
|
extern int swi_moshmoon2(double jd, double *x);
|
||||||
extern int swi_intp_apsides(double J, double *pol, int ipli);
|
extern int swi_intp_apsides(double J, double *pol, int ipli);
|
||||||
|
|
||||||
/* planets, s. moshplan.c */
|
/* planets, s. moshplan.c */
|
||||||
extern int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *xeret, char *serr);
|
extern int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret,
|
||||||
|
double *xeret, char *serr);
|
||||||
extern int swi_moshplan2(double J, int iplm, double *pobj);
|
extern int swi_moshplan2(double J, int iplm, double *pobj);
|
||||||
extern int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, double *xsun, char *serr);
|
extern int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli,
|
||||||
|
double *xearth, double *xsun, char *serr);
|
||||||
extern FILE *swi_fopen(int ifno, char *fname, char *ephepath, char *serr);
|
extern FILE *swi_fopen(int ifno, char *fname, char *ephepath, char *serr);
|
||||||
|
|
||||||
/* nutation */
|
/* nutation */
|
||||||
struct nut {
|
struct nut
|
||||||
|
{
|
||||||
double tnut;
|
double tnut;
|
||||||
double nutlo[2]; /* nutation in longitude and obliquity */
|
double nutlo[2]; /* nutation in longitude and obliquity */
|
||||||
double snut, cnut; /* sine and cosine of nutation in obliquity */
|
double snut, cnut; /* sine and cosine of nutation in obliquity */
|
||||||
double matrix[3][3];
|
double matrix[3][3];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct plantbl {
|
struct plantbl
|
||||||
|
{
|
||||||
char max_harmonic[9];
|
char max_harmonic[9];
|
||||||
char max_power_of_t;
|
char max_power_of_t;
|
||||||
signed char *arg_tbl;
|
signed char *arg_tbl;
|
||||||
@ -479,7 +494,8 @@ struct plantbl {
|
|||||||
double distance;
|
double distance;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct file_data {
|
struct file_data
|
||||||
|
{
|
||||||
char fnam[AS_MAXCH]; /* ephemeris file name */
|
char fnam[AS_MAXCH]; /* ephemeris file name */
|
||||||
int fversion; /* version number of file */
|
int fversion; /* version number of file */
|
||||||
char astnam[50]; /* asteroid name, if asteroid file */
|
char astnam[50]; /* asteroid name, if asteroid file */
|
||||||
@ -493,15 +509,13 @@ struct file_data {
|
|||||||
int ipl[SEI_FILE_NMAXPLAN]; /* planet numbers */
|
int ipl[SEI_FILE_NMAXPLAN]; /* planet numbers */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gen_const {
|
struct gen_const
|
||||||
double clight,
|
{
|
||||||
aunit,
|
double clight, aunit, helgravconst, ratme, sunradius;
|
||||||
helgravconst,
|
|
||||||
ratme,
|
|
||||||
sunradius;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct save_positions {
|
struct save_positions
|
||||||
|
{
|
||||||
int ipl;
|
int ipl;
|
||||||
double tsave;
|
double tsave;
|
||||||
int32 iflgsave;
|
int32 iflgsave;
|
||||||
@ -515,7 +529,8 @@ struct save_positions {
|
|||||||
double xsaves[24];
|
double xsaves[24];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct node_data {
|
struct node_data
|
||||||
|
{
|
||||||
/* result of most recent data evaluation for this body: */
|
/* result of most recent data evaluation for this body: */
|
||||||
double teval; /* time for which last computation was made */
|
double teval; /* time for which last computation was made */
|
||||||
int32 iephe; /* which ephemeris was used */
|
int32 iephe; /* which ephemeris was used */
|
||||||
@ -529,20 +544,23 @@ struct node_data {
|
|||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct topo_data {
|
struct topo_data
|
||||||
|
{
|
||||||
double geolon, geolat, geoalt;
|
double geolon, geolat, geoalt;
|
||||||
double teval;
|
double teval;
|
||||||
double tjd_ut;
|
double tjd_ut;
|
||||||
double xobs[6];
|
double xobs[6];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sid_data {
|
struct sid_data
|
||||||
|
{
|
||||||
int32 sid_mode;
|
int32 sid_mode;
|
||||||
double ayan_t0;
|
double ayan_t0;
|
||||||
double t0;
|
double t0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct swe_data {
|
struct swe_data
|
||||||
|
{
|
||||||
AS_BOOL ephe_path_is_set;
|
AS_BOOL ephe_path_is_set;
|
||||||
short jpl_file_is_open;
|
short jpl_file_is_open;
|
||||||
FILE *fixfp; /* fixed stars file pointer */
|
FILE *fixfp; /* fixed stars file pointer */
|
||||||
@ -560,7 +578,7 @@ struct swe_data {
|
|||||||
#else
|
#else
|
||||||
struct plan_data nddat[SEI_NNODE_ETC];
|
struct plan_data nddat[SEI_NNODE_ETC];
|
||||||
#endif
|
#endif
|
||||||
struct save_positions savedat[SE_NPLANETS+1];
|
struct save_positions savedat[SE_NPLANETS + 1];
|
||||||
struct epsilon oec;
|
struct epsilon oec;
|
||||||
struct epsilon oec2000;
|
struct epsilon oec2000;
|
||||||
struct nut nut;
|
struct nut nut;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
$Header: /home/dieter/sweph/RCS/swephexp.h,v 1.75 2009/04/08 07:19:08 dieter Exp $
|
$Header: /home/dieter/sweph/RCS/swephexp.h,v 1.75 2009/04/08 07:19:08 dieter Exp $
|
||||||
SWISSEPH: exported definitions and constants
|
SWISSEPH: exported definitions and constants
|
||||||
@ -19,6 +20,7 @@
|
|||||||
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -74,7 +76,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C"
|
||||||
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _SWEPHEXP_INCLUDED /* allow multiple #includes of swephexp.h */
|
#ifndef _SWEPHEXP_INCLUDED /* allow multiple #includes of swephexp.h */
|
||||||
@ -87,8 +90,8 @@ extern "C" {
|
|||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
|
||||||
/* values for gregflag in swe_julday() and swe_revjul() */
|
/* values for gregflag in swe_julday() and swe_revjul() */
|
||||||
# define SE_JUL_CAL 0
|
#define SE_JUL_CAL 0
|
||||||
# define SE_GREG_CAL 1
|
#define SE_GREG_CAL 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* planet numbers for the ipl parameter in swe_calc()
|
* planet numbers for the ipl parameter in swe_calc()
|
||||||
@ -142,6 +145,7 @@ extern "C" {
|
|||||||
#define SE_ADMETOS 45
|
#define SE_ADMETOS 45
|
||||||
#define SE_VULKANUS 46
|
#define SE_VULKANUS 46
|
||||||
#define SE_POSEIDON 47
|
#define SE_POSEIDON 47
|
||||||
|
|
||||||
/* other fictitious bodies */
|
/* other fictitious bodies */
|
||||||
#define SE_ISIS 48
|
#define SE_ISIS 48
|
||||||
#define SE_NIBIRU 49
|
#define SE_NIBIRU 49
|
||||||
@ -188,7 +192,7 @@ extern "C" {
|
|||||||
#define SEFLG_J2000 32 /* no precession, i.e. give J2000 equinox */
|
#define SEFLG_J2000 32 /* no precession, i.e. give J2000 equinox */
|
||||||
#define SEFLG_NONUT 64 /* no nutation, i.e. mean equinox of date */
|
#define SEFLG_NONUT 64 /* no nutation, i.e. mean equinox of date */
|
||||||
#define SEFLG_SPEED3 128 /* speed from 3 positions (do not use it,
|
#define SEFLG_SPEED3 128 /* speed from 3 positions (do not use it,
|
||||||
SEFLG_SPEED is faster and more precise.) */
|
* SEFLG_SPEED is faster and more precise.) */
|
||||||
#define SEFLG_SPEED 256 /* high precision speed */
|
#define SEFLG_SPEED 256 /* high precision speed */
|
||||||
#define SEFLG_NOGDEFL 512 /* turn off gravitational deflection */
|
#define SEFLG_NOGDEFL 512 /* turn off gravitational deflection */
|
||||||
#define SEFLG_NOABERR 1024 /* turn off 'annual' aberration of light */
|
#define SEFLG_NOABERR 1024 /* turn off 'annual' aberration of light */
|
||||||
@ -201,8 +205,10 @@ extern "C" {
|
|||||||
#define SEFLG_ICRS (128*1024) /* ICRS (DE406 reference frame) */
|
#define SEFLG_ICRS (128*1024) /* ICRS (DE406 reference frame) */
|
||||||
|
|
||||||
#define SE_SIDBITS 256
|
#define SE_SIDBITS 256
|
||||||
|
|
||||||
/* for projection onto ecliptic of t0 */
|
/* for projection onto ecliptic of t0 */
|
||||||
#define SE_SIDBIT_ECL_T0 256
|
#define SE_SIDBIT_ECL_T0 256
|
||||||
|
|
||||||
/* for projection onto solar system plane */
|
/* for projection onto solar system plane */
|
||||||
#define SE_SIDBIT_SSY_PLANE 512
|
#define SE_SIDBIT_SSY_PLANE 512
|
||||||
|
|
||||||
@ -330,32 +336,32 @@ extern "C" {
|
|||||||
#ifndef SE_EPHE_PATH
|
#ifndef SE_EPHE_PATH
|
||||||
#if MSDOS
|
#if MSDOS
|
||||||
#ifdef PAIR_SWEPH
|
#ifdef PAIR_SWEPH
|
||||||
# define SE_EPHE_PATH "\\pair\\ephe\\"
|
#define SE_EPHE_PATH "\\pair\\ephe\\"
|
||||||
#else
|
#else
|
||||||
# define SE_EPHE_PATH "\\sweph\\ephe\\"
|
#define SE_EPHE_PATH "\\sweph\\ephe\\"
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
# ifdef MACOS
|
#ifdef MACOS
|
||||||
# define SE_EPHE_PATH ":ephe:"
|
#define SE_EPHE_PATH ":ephe:"
|
||||||
# else
|
#else
|
||||||
# define SE_EPHE_PATH ".:/users/ephe2/:/users/ephe/"
|
#define SE_EPHE_PATH ".:/users/ephe2/:/users/ephe/"
|
||||||
/* At Astrodienst, we maintain two ephemeris areas for
|
/* At Astrodienst, we maintain two ephemeris areas for
|
||||||
the thousands of asteroid files:
|
* the thousands of asteroid files:
|
||||||
the short files in /users/ephe/ast*,
|
* the short files in /users/ephe/ast*,
|
||||||
the long file in /users/ephe2/ast*. */
|
* the long file in /users/ephe2/ast*. */
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif /* SE_EPHE_PATH */
|
#endif /* SE_EPHE_PATH */
|
||||||
|
|
||||||
/* defines for function swe_split_deg() (in swephlib.c) */
|
/* defines for function swe_split_deg() (in swephlib.c) */
|
||||||
# define SE_SPLIT_DEG_ROUND_SEC 1
|
#define SE_SPLIT_DEG_ROUND_SEC 1
|
||||||
# define SE_SPLIT_DEG_ROUND_MIN 2
|
#define SE_SPLIT_DEG_ROUND_MIN 2
|
||||||
# define SE_SPLIT_DEG_ROUND_DEG 4
|
#define SE_SPLIT_DEG_ROUND_DEG 4
|
||||||
# define SE_SPLIT_DEG_ZODIACAL 8
|
#define SE_SPLIT_DEG_ZODIACAL 8
|
||||||
# define SE_SPLIT_DEG_KEEP_SIGN 16 /* don't round to next sign,
|
#define SE_SPLIT_DEG_KEEP_SIGN 16 /* don't round to next sign,
|
||||||
* e.g. 29.9999999 will be rounded
|
* e.g. 29.9999999 will be rounded
|
||||||
* to 29d59'59" (or 29d59' or 29d) */
|
* to 29d59'59" (or 29d59' or 29d) */
|
||||||
# define SE_SPLIT_DEG_KEEP_DEG 32 /* don't round to next degree
|
#define SE_SPLIT_DEG_KEEP_DEG 32 /* don't round to next degree
|
||||||
* e.g. 13.9999999 will be rounded
|
* e.g. 13.9999999 will be rounded
|
||||||
* to 13d59'59" (or 13d59' or 13d) */
|
* to 13d59'59" (or 13d59' or 13d) */
|
||||||
|
|
||||||
@ -415,7 +421,7 @@ extern "C" {
|
|||||||
* Astrodienst's partner software PAIR.
|
* Astrodienst's partner software PAIR.
|
||||||
*/
|
*/
|
||||||
#ifdef PAIR_SWEPH
|
#ifdef PAIR_SWEPH
|
||||||
# define NO_JPL
|
#define NO_JPL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**************************************************************
|
/**************************************************************
|
||||||
@ -426,59 +432,59 @@ extern "C" {
|
|||||||
* and skip to the export function decarations below.
|
* and skip to the export function decarations below.
|
||||||
************************************************************/
|
************************************************************/
|
||||||
#if defined(MAKE_DLL) || defined(USE_DLL) || defined(_WINDOWS)
|
#if defined(MAKE_DLL) || defined(USE_DLL) || defined(_WINDOWS)
|
||||||
# include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_DLL
|
#ifdef USE_DLL
|
||||||
# include "swedll.h"
|
#include "swedll.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DOS32) || !MSDOS || defined(WIN32)
|
#if defined(DOS32) || !MSDOS || defined(WIN32)
|
||||||
/* use compiler switch to define DOS32 */
|
/* use compiler switch to define DOS32 */
|
||||||
# ifndef FAR
|
#ifndef FAR
|
||||||
# define FAR
|
#define FAR
|
||||||
# endif
|
#endif
|
||||||
# define MALLOC malloc
|
#define MALLOC malloc
|
||||||
# define CALLOC calloc
|
#define CALLOC calloc
|
||||||
# define FREE free
|
#define FREE free
|
||||||
#else
|
#else
|
||||||
# ifndef FAR
|
#ifndef FAR
|
||||||
# define FAR far
|
#define FAR far
|
||||||
# endif
|
#endif
|
||||||
# ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
# include <alloc.h>
|
#include <alloc.h>
|
||||||
# define MALLOC farmalloc
|
#define MALLOC farmalloc
|
||||||
# define CALLOC farcalloc
|
#define CALLOC farcalloc
|
||||||
# define FREE farfree
|
#define FREE farfree
|
||||||
# else
|
#else
|
||||||
# define MALLOC _fmalloc
|
#define MALLOC _fmalloc
|
||||||
# define CALLOC _fcalloc
|
#define CALLOC _fcalloc
|
||||||
# define FREE _ffree
|
#define FREE _ffree
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* DLL defines */
|
/* DLL defines */
|
||||||
#ifdef MAKE_DLL
|
#ifdef MAKE_DLL
|
||||||
#if defined (PASCAL)
|
#if defined (PASCAL)
|
||||||
#define PASCAL_CONV PASCAL
|
#define PASCAL_CONV PASCAL
|
||||||
#else
|
|
||||||
#define PASCAL_CONV
|
|
||||||
#endif
|
|
||||||
#ifdef MAKE_DLL16 /* 16bit DLL */
|
|
||||||
/* We compiled the 16bit DLL for Windows 3.x using Borland C/C++ Ver:3.x
|
|
||||||
and the -WD or -WDE compiler switch. */
|
|
||||||
#define EXP16 __export
|
|
||||||
#define EXP32
|
|
||||||
#else /* 32bit DLL */
|
|
||||||
/* To export symbols in the new DLL model of Win32, Microsoft
|
|
||||||
recommends the following approach */
|
|
||||||
#define EXP16
|
|
||||||
#define EXP32 __declspec( dllexport )
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#define PASCAL_CONV
|
#define PASCAL_CONV
|
||||||
#define EXP16
|
#endif
|
||||||
#define EXP32
|
#ifdef MAKE_DLL16 /* 16bit DLL */
|
||||||
|
/* We compiled the 16bit DLL for Windows 3.x using Borland C/C++ Ver:3.x
|
||||||
|
* and the -WD or -WDE compiler switch. */
|
||||||
|
#define EXP16 __export
|
||||||
|
#define EXP32
|
||||||
|
#else /* 32bit DLL */
|
||||||
|
/* To export symbols in the new DLL model of Win32, Microsoft
|
||||||
|
* recommends the following approach */
|
||||||
|
#define EXP16
|
||||||
|
#define EXP32 __declspec( dllexport )
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define PASCAL_CONV
|
||||||
|
#define EXP16
|
||||||
|
#define EXP32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _SWEDLL_H
|
#ifndef _SWEDLL_H
|
||||||
@ -490,219 +496,238 @@ extern "C" {
|
|||||||
#define ext_def(x) extern EXP32 x FAR PASCAL_CONV EXP16
|
#define ext_def(x) extern EXP32 x FAR PASCAL_CONV EXP16
|
||||||
/* ext_def(x) evaluates to x on Unix */
|
/* ext_def(x) evaluates to x on Unix */
|
||||||
|
|
||||||
ext_def(int32) swe_heliacal_ut(double tjdstart_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
|
ext_def(int32) swe_heliacal_ut(double tjdstart_ut, double *geopos,
|
||||||
ext_def(int32) swe_heliacal_pheno_ut(double tjd_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
|
double *datm, double *dobs,
|
||||||
ext_def(int32) swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
|
char *ObjectName, int32 TypeEvent,
|
||||||
|
int32 iflag, double *dret, char *serr);
|
||||||
|
ext_def(int32) swe_heliacal_pheno_ut(double tjd_ut, double *geopos,
|
||||||
|
double *datm, double *dobs,
|
||||||
|
char *ObjectName, int32 TypeEvent,
|
||||||
|
int32 helflag, double *darr,
|
||||||
|
char *serr);
|
||||||
|
ext_def(int32) swe_vis_limit_mag(double tjdut, double *geopos,
|
||||||
|
double *datm, double *dobs,
|
||||||
|
char *ObjectName, int32 helflag,
|
||||||
|
double *dret, char *serr);
|
||||||
|
|
||||||
/* the following are secret, for Victor Reijs' */
|
/* the following are secret, for Victor Reijs' */
|
||||||
ext_def(int32) swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
ext_def(int32) swe_heliacal_angle(double tjdut, double *dgeo,
|
||||||
ext_def(int32) swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
double *datm, double *dobs,
|
||||||
|
int32 helflag, double mag,
|
||||||
|
double azi_obj, double azi_sun,
|
||||||
|
double azi_moon, double alt_moon,
|
||||||
|
double *dret, char *serr);
|
||||||
|
ext_def(int32) swe_topo_arcus_visionis(double tjdut, double *dgeo,
|
||||||
|
double *datm, double *dobs,
|
||||||
|
int32 helflag, double mag,
|
||||||
|
double azi_obj, double alt_obj,
|
||||||
|
double azi_sun, double azi_moon,
|
||||||
|
double alt_moon, double *dret,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* exports from sweph.c
|
* exports from sweph.c
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
ext_def(char *) swe_version(char *);
|
ext_def(char *) swe_version(char *);
|
||||||
|
|
||||||
/* planets, moon, nodes etc. */
|
/* planets, moon, nodes etc. */
|
||||||
ext_def( int32 ) swe_calc(
|
ext_def(int32) swe_calc(double tjd, int ipl, int32 iflag, double *xx,
|
||||||
double tjd, int ipl, int32 iflag,
|
|
||||||
double *xx,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
|
||||||
ext_def(int32) swe_calc_ut(double tjd_ut, int32 ipl, int32 iflag,
|
ext_def(int32) swe_calc_ut(double tjd_ut, int32 ipl, int32 iflag,
|
||||||
double *xx, char *serr);
|
double *xx, char *serr);
|
||||||
|
|
||||||
/* fixed stars */
|
/* fixed stars */
|
||||||
ext_def( int32 ) swe_fixstar(
|
ext_def(int32) swe_fixstar(char *star, double tjd, int32 iflag,
|
||||||
char *star, double tjd, int32 iflag,
|
|
||||||
double *xx,
|
|
||||||
char *serr);
|
|
||||||
|
|
||||||
ext_def(int32) swe_fixstar_ut(char *star, double tjd_ut, int32 iflag,
|
|
||||||
double *xx, char *serr);
|
double *xx, char *serr);
|
||||||
|
|
||||||
ext_def(int32) swe_fixstar_mag(char *star, double *mag, char *serr);
|
ext_def(int32) swe_fixstar_ut(char *star, double tjd_ut, int32 iflag,
|
||||||
|
double *xx, char *serr);
|
||||||
|
|
||||||
|
ext_def(int32) swe_fixstar_mag(char *star, double *mag, char *serr);
|
||||||
|
|
||||||
/* close Swiss Ephemeris */
|
/* close Swiss Ephemeris */
|
||||||
ext_def( void ) swe_close(void);
|
ext_def(void) swe_close(void);
|
||||||
|
|
||||||
/* set directory path of ephemeris files */
|
/* set directory path of ephemeris files */
|
||||||
ext_def( void ) swe_set_ephe_path(char *path);
|
ext_def(void) swe_set_ephe_path(char *path);
|
||||||
|
|
||||||
/* set file name of JPL file */
|
/* set file name of JPL file */
|
||||||
ext_def( void ) swe_set_jpl_file(char *fname);
|
ext_def(void) swe_set_jpl_file(char *fname);
|
||||||
|
|
||||||
/* get planet name */
|
/* get planet name */
|
||||||
ext_def( char *) swe_get_planet_name(int ipl, char *spname);
|
ext_def(char *) swe_get_planet_name(int ipl, char *spname);
|
||||||
|
|
||||||
/* set geographic position of observer */
|
/* set geographic position of observer */
|
||||||
ext_def (void) swe_set_topo(double geolon, double geolat, double geoalt);
|
ext_def(void) swe_set_topo(double geolon, double geolat, double geoalt);
|
||||||
|
|
||||||
/* set sidereal mode */
|
/* set sidereal mode */
|
||||||
ext_def(void) swe_set_sid_mode(int32 sid_mode, double t0, double ayan_t0);
|
ext_def(void) swe_set_sid_mode(int32 sid_mode, double t0,
|
||||||
|
double ayan_t0);
|
||||||
|
|
||||||
/* get ayanamsa */
|
/* get ayanamsa */
|
||||||
ext_def(double) swe_get_ayanamsa(double tjd_et);
|
ext_def(double) swe_get_ayanamsa(double tjd_et);
|
||||||
|
|
||||||
ext_def(double) swe_get_ayanamsa_ut(double tjd_ut);
|
ext_def(double) swe_get_ayanamsa_ut(double tjd_ut);
|
||||||
|
|
||||||
ext_def( char *) swe_get_ayanamsa_name(int32 isidmode);
|
ext_def(char *) swe_get_ayanamsa_name(int32 isidmode);
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* exports from swedate.c
|
* exports from swedate.c
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
ext_def( int ) swe_date_conversion(
|
ext_def(int) swe_date_conversion(int y, int m, int d, /* year, month, day */
|
||||||
int y , int m , int d , /* year, month, day */
|
|
||||||
double utime, /* universal time in hours (decimal) */
|
double utime, /* universal time in hours (decimal) */
|
||||||
char c, /* calendar g[regorian]|j[ulian] */
|
char c, /* calendar g[regorian]|j[ulian] */
|
||||||
double *tjd);
|
double *tjd);
|
||||||
|
|
||||||
ext_def( double ) swe_julday(
|
ext_def(double) swe_julday(int year, int month, int day, double hour,
|
||||||
int year, int month, int day, double hour,
|
|
||||||
int gregflag);
|
int gregflag);
|
||||||
|
|
||||||
ext_def( void ) swe_revjul (
|
ext_def(void) swe_revjul(double jd, int gregflag, int *jyear, int *jmon,
|
||||||
double jd,
|
int *jday, double *jut);
|
||||||
int gregflag,
|
|
||||||
int *jyear, int *jmon, int *jday, double *jut);
|
|
||||||
|
|
||||||
ext_def(int32) swe_utc_to_jd(
|
ext_def(int32) swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday,
|
||||||
int32 iyear, int32 imonth, int32 iday,
|
|
||||||
int32 ihour, int32 imin, double dsec,
|
int32 ihour, int32 imin, double dsec,
|
||||||
int32 gregflag, double *dret, char *serr);
|
int32 gregflag, double *dret, char *serr);
|
||||||
|
|
||||||
ext_def(void) swe_jdet_to_utc(
|
ext_def(void) swe_jdet_to_utc(double tjd_et, int32 gregflag,
|
||||||
double tjd_et, int32 gregflag,
|
int32 * iyear, int32 * imonth,
|
||||||
int32 *iyear, int32 *imonth, int32 *iday,
|
int32 * iday, int32 * ihour, int32 * imin,
|
||||||
int32 *ihour, int32 *imin, double *dsec);
|
double *dsec);
|
||||||
|
|
||||||
ext_def(void) swe_jdut1_to_utc(
|
ext_def(void) swe_jdut1_to_utc(double tjd_ut, int32 gregflag,
|
||||||
double tjd_ut, int32 gregflag,
|
int32 * iyear, int32 * imonth,
|
||||||
int32 *iyear, int32 *imonth, int32 *iday,
|
int32 * iday, int32 * ihour,
|
||||||
int32 *ihour, int32 *imin, double *dsec);
|
int32 * imin, double *dsec);
|
||||||
|
|
||||||
ext_def(void) swe_utc_time_zone(
|
ext_def(void) swe_utc_time_zone(int32 iyear, int32 imonth, int32 iday,
|
||||||
int32 iyear, int32 imonth, int32 iday,
|
|
||||||
int32 ihour, int32 imin, double dsec,
|
int32 ihour, int32 imin, double dsec,
|
||||||
double d_timezone,
|
double d_timezone, int32 * iyear_out,
|
||||||
int32 *iyear_out, int32 *imonth_out, int32 *iday_out,
|
int32 * imonth_out, int32 * iday_out,
|
||||||
int32 *ihour_out, int32 *imin_out, double *dsec_out);
|
int32 * ihour_out, int32 * imin_out,
|
||||||
|
double *dsec_out);
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* exports from swehouse.c
|
* exports from swehouse.c
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
ext_def( int ) swe_houses(
|
ext_def(int) swe_houses(double tjd_ut, double geolat, double geolon,
|
||||||
double tjd_ut, double geolat, double geolon, int hsys,
|
int hsys, double *cusps, double *ascmc);
|
||||||
double *cusps, double *ascmc);
|
|
||||||
|
|
||||||
ext_def( int ) swe_houses_ex(
|
ext_def(int) swe_houses_ex(double tjd_ut, int32 iflag, double geolat,
|
||||||
double tjd_ut, int32 iflag, double geolat, double geolon, int hsys,
|
double geolon, int hsys, double *cusps,
|
||||||
double *cusps, double *ascmc);
|
double *ascmc);
|
||||||
|
|
||||||
ext_def( int ) swe_houses_armc(
|
ext_def(int) swe_houses_armc(double armc, double geolat, double eps,
|
||||||
double armc, double geolat, double eps, int hsys,
|
int hsys, double *cusps, double *ascmc);
|
||||||
double *cusps, double *ascmc);
|
|
||||||
|
|
||||||
ext_def(double) swe_house_pos(
|
ext_def(double) swe_house_pos(double armc, double geolat, double eps,
|
||||||
double armc, double geolat, double eps, int hsys, double *xpin, char *serr);
|
int hsys, double *xpin, char *serr);
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* exports from swecl.c
|
* exports from swecl.c
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
ext_def(int32) swe_gauquelin_sector(double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr);
|
ext_def(int32) swe_gauquelin_sector(double t_ut, int32 ipl,
|
||||||
|
char *starname, int32 iflag,
|
||||||
|
int32 imeth, double *geopos,
|
||||||
|
double atpress, double attemp,
|
||||||
|
double *dgsect, char *serr);
|
||||||
|
|
||||||
/* computes geographic location and attributes of solar
|
/* computes geographic location and attributes of solar
|
||||||
* eclipse at a given tjd */
|
* eclipse at a given tjd */
|
||||||
ext_def (int32) swe_sol_eclipse_where(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
ext_def(int32) swe_sol_eclipse_where(double tjd, int32 ifl,
|
||||||
|
double *geopos, double *attr,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
ext_def (int32) swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
|
ext_def(int32) 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, geolon, geolat */
|
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
||||||
ext_def (int32) swe_sol_eclipse_how(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
ext_def(int32) swe_sol_eclipse_how(double tjd, int32 ifl,
|
||||||
|
double *geopos, double *attr,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
/* finds time of next local eclipse */
|
/* finds time of next local eclipse */
|
||||||
ext_def (int32) swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
ext_def(int32) swe_sol_eclipse_when_loc(double tjd_start, int32 ifl,
|
||||||
|
double *geopos, double *tret,
|
||||||
|
double *attr, int32 backward,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
ext_def (int32) swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl,
|
ext_def(int32) swe_lun_occult_when_loc(double tjd_start, int32 ipl,
|
||||||
double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
char *starname, int32 ifl,
|
||||||
|
double *geopos, double *tret,
|
||||||
|
double *attr, int32 backward,
|
||||||
|
char *serr);
|
||||||
|
|
||||||
/* finds time of next eclipse globally */
|
/* finds time of next eclipse globally */
|
||||||
ext_def (int32) swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype,
|
ext_def(int32) swe_sol_eclipse_when_glob(double tjd_start, int32 ifl,
|
||||||
double *tret, int32 backward, char *serr);
|
int32 ifltype, double *tret,
|
||||||
|
int32 backward, char *serr);
|
||||||
|
|
||||||
/* finds time of next occultation globally */
|
/* finds time of next occultation globally */
|
||||||
ext_def (int32) swe_lun_occult_when_glob(double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype,
|
ext_def(int32) swe_lun_occult_when_glob(double tjd_start, int32 ipl,
|
||||||
double *tret, int32 backward, char *serr);
|
char *starname, int32 ifl,
|
||||||
|
int32 ifltype, double *tret,
|
||||||
|
int32 backward, char *serr);
|
||||||
|
|
||||||
/* computes attributes of a lunar eclipse for given tjd */
|
/* computes attributes of a lunar eclipse for given tjd */
|
||||||
ext_def (int32) swe_lun_eclipse_how(
|
ext_def(int32) swe_lun_eclipse_how(double tjd_ut, int32 ifl,
|
||||||
double tjd_ut,
|
double *geopos, double *attr,
|
||||||
int32 ifl,
|
|
||||||
double *geopos,
|
|
||||||
double *attr,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
|
||||||
ext_def (int32) swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype,
|
ext_def(int32) swe_lun_eclipse_when(double tjd_start, int32 ifl,
|
||||||
double *tret, int32 backward, char *serr);
|
int32 ifltype, double *tret,
|
||||||
|
int32 backward, char *serr);
|
||||||
|
|
||||||
/* planetary phenomena */
|
/* planetary phenomena */
|
||||||
ext_def (int32) swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr);
|
ext_def(int32) swe_pheno(double tjd, int32 ipl, int32 iflag,
|
||||||
|
double *attr, char *serr);
|
||||||
|
|
||||||
ext_def(int32) swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
ext_def(int32) swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag,
|
||||||
|
double *attr, char *serr);
|
||||||
|
|
||||||
ext_def (double) swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag);
|
ext_def(double) swe_refrac(double inalt, double atpress, double attemp,
|
||||||
|
int32 calc_flag);
|
||||||
|
|
||||||
ext_def (double) swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret);
|
ext_def(double) swe_refrac_extended(double inalt, double geoalt,
|
||||||
|
double atpress, double attemp,
|
||||||
|
double lapse_rate, int32 calc_flag,
|
||||||
|
double *dret);
|
||||||
|
|
||||||
ext_def (void) swe_set_lapse_rate(double lapse_rate);
|
ext_def(void) swe_set_lapse_rate(double lapse_rate);
|
||||||
|
|
||||||
ext_def (void) swe_azalt(
|
ext_def(void) swe_azalt(double tjd_ut, int32 calc_flag, double *geopos,
|
||||||
double tjd_ut,
|
double atpress, double attemp, double *xin,
|
||||||
int32 calc_flag,
|
|
||||||
double *geopos,
|
|
||||||
double atpress,
|
|
||||||
double attemp,
|
|
||||||
double *xin,
|
|
||||||
double *xaz);
|
double *xaz);
|
||||||
|
|
||||||
ext_def (void) swe_azalt_rev(
|
ext_def(void) swe_azalt_rev(double tjd_ut, int32 calc_flag,
|
||||||
double tjd_ut,
|
double *geopos, double *xin, double *xout);
|
||||||
int32 calc_flag,
|
|
||||||
double *geopos,
|
|
||||||
double *xin,
|
|
||||||
double *xout);
|
|
||||||
|
|
||||||
ext_def (int32) swe_rise_trans_true_hor(
|
ext_def(int32) swe_rise_trans_true_hor(double tjd_ut, int32 ipl,
|
||||||
double tjd_ut, int32 ipl, char *starname,
|
char *starname, int32 epheflag,
|
||||||
int32 epheflag, int32 rsmi,
|
int32 rsmi, double *geopos,
|
||||||
double *geopos,
|
|
||||||
double atpress, double attemp,
|
double atpress, double attemp,
|
||||||
double horhgt,
|
double horhgt, double *tret,
|
||||||
double *tret,
|
|
||||||
char *serr);
|
char *serr);
|
||||||
|
|
||||||
ext_def (int32) swe_rise_trans(
|
ext_def(int32) swe_rise_trans(double tjd_ut, int32 ipl, char *starname,
|
||||||
double tjd_ut, int32 ipl, char *starname,
|
|
||||||
int32 epheflag, int32 rsmi,
|
int32 epheflag, int32 rsmi,
|
||||||
double *geopos,
|
double *geopos, double atpress,
|
||||||
double atpress, double attemp,
|
double attemp, double *tret, char *serr);
|
||||||
double *tret,
|
|
||||||
char *serr);
|
|
||||||
|
|
||||||
ext_def (int32) swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
|
ext_def(int32) swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
|
||||||
int32 method,
|
int32 method, double *xnasc, double *xndsc,
|
||||||
double *xnasc, double *xndsc,
|
double *xperi, double *xaphe, char *serr);
|
||||||
double *xperi, double *xaphe,
|
|
||||||
char *serr);
|
|
||||||
|
|
||||||
ext_def (int32) swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
ext_def(int32) swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
||||||
int32 method,
|
int32 method, double *xnasc,
|
||||||
double *xnasc, double *xndsc,
|
double *xndsc, double *xperi,
|
||||||
double *xperi, double *xaphe,
|
double *xaphe, char *serr);
|
||||||
char *serr);
|
|
||||||
|
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
@ -710,29 +735,31 @@ ext_def (int32) swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
|||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
/* delta t */
|
/* delta t */
|
||||||
ext_def( double ) swe_deltat(double tjd);
|
ext_def(double) swe_deltat(double tjd);
|
||||||
|
|
||||||
/* equation of time */
|
/* equation of time */
|
||||||
ext_def( int ) swe_time_equ(double tjd, double *te, char *serr);
|
ext_def(int) swe_time_equ(double tjd, double *te, char *serr);
|
||||||
|
|
||||||
/* sidereal time */
|
/* sidereal time */
|
||||||
ext_def( double ) swe_sidtime0(double tjd_ut, double eps, double nut);
|
ext_def(double) swe_sidtime0(double tjd_ut, double eps, double nut);
|
||||||
ext_def( double ) swe_sidtime(double tjd_ut);
|
ext_def(double) swe_sidtime(double tjd_ut);
|
||||||
|
|
||||||
/* coordinate transformation polar -> polar */
|
/* coordinate transformation polar -> polar */
|
||||||
ext_def( void ) swe_cotrans(double *xpo, double *xpn, double eps);
|
ext_def(void) swe_cotrans(double *xpo, double *xpn, double eps);
|
||||||
ext_def( void ) swe_cotrans_sp(double *xpo, double *xpn, double eps);
|
ext_def(void) swe_cotrans_sp(double *xpo, double *xpn, double eps);
|
||||||
|
|
||||||
/* tidal acceleration to be used in swe_deltat() */
|
/* tidal acceleration to be used in swe_deltat() */
|
||||||
ext_def( double ) swe_get_tid_acc(void);
|
ext_def(double) swe_get_tid_acc(void);
|
||||||
ext_def( void ) swe_set_tid_acc(double t_acc);
|
ext_def(void) swe_set_tid_acc(double t_acc);
|
||||||
|
|
||||||
ext_def( double ) swe_degnorm(double x);
|
ext_def(double) swe_degnorm(double x);
|
||||||
ext_def( double ) swe_radnorm(double x);
|
ext_def(double) swe_radnorm(double x);
|
||||||
ext_def( double ) swe_rad_midp(double x1, double x0);
|
ext_def(double) swe_rad_midp(double x1, double x0);
|
||||||
ext_def( double ) swe_deg_midp(double x1, double x0);
|
ext_def(double) swe_deg_midp(double x1, double x0);
|
||||||
|
|
||||||
ext_def( void ) swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
ext_def(void) swe_split_deg(double ddeg, int32 roundflag, int32 * ideg,
|
||||||
|
int32 * imin, int32 * isec, double *dsecfr,
|
||||||
|
int32 * isgn);
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
* other functions from swephlib.c;
|
* other functions from swephlib.c;
|
||||||
@ -741,33 +768,35 @@ ext_def( void ) swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *
|
|||||||
********************************************************/
|
********************************************************/
|
||||||
|
|
||||||
/* normalize argument into interval [0..DEG360] */
|
/* normalize argument into interval [0..DEG360] */
|
||||||
ext_def( centisec ) swe_csnorm(centisec p);
|
ext_def(centisec) swe_csnorm(centisec p);
|
||||||
|
|
||||||
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
||||||
ext_def( centisec ) swe_difcsn (centisec p1, centisec p2);
|
ext_def(centisec) swe_difcsn(centisec p1, centisec p2);
|
||||||
|
|
||||||
ext_def( double ) swe_difdegn (double p1, double p2);
|
ext_def(double) swe_difdegn(double p1, double p2);
|
||||||
|
|
||||||
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
||||||
ext_def( centisec ) swe_difcs2n(centisec p1, centisec p2);
|
ext_def(centisec) swe_difcs2n(centisec p1, centisec p2);
|
||||||
|
|
||||||
ext_def( double ) swe_difdeg2n(double p1, double p2);
|
ext_def(double) swe_difdeg2n(double p1, double p2);
|
||||||
ext_def( double ) swe_difrad2n(double p1, double p2);
|
ext_def(double) swe_difrad2n(double p1, double p2);
|
||||||
|
|
||||||
/* round second, but at 29.5959 always down */
|
/* round second, but at 29.5959 always down */
|
||||||
ext_def( centisec ) swe_csroundsec(centisec x);
|
ext_def(centisec) swe_csroundsec(centisec x);
|
||||||
|
|
||||||
/* double to int32 with rounding, no overflow check */
|
/* double to int32 with rounding, no overflow check */
|
||||||
ext_def( int32 ) swe_d2l(double x);
|
ext_def(int32) swe_d2l(double x);
|
||||||
|
|
||||||
/* monday = 0, ... sunday = 6 */
|
/* monday = 0, ... sunday = 6 */
|
||||||
ext_def( int ) swe_day_of_week(double jd);
|
ext_def(int) swe_day_of_week(double jd);
|
||||||
|
|
||||||
ext_def( char *) swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
ext_def(char *) swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero,
|
||||||
|
char *a);
|
||||||
|
|
||||||
ext_def( char *) swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
|
ext_def(char *) swe_cs2lonlatstr(CSEC t, char pchar, char mchar,
|
||||||
|
char *s);
|
||||||
|
|
||||||
ext_def( char *) swe_cs2degstr(CSEC t, char *a);
|
ext_def(char *) swe_cs2degstr(CSEC t, char *a);
|
||||||
|
|
||||||
#endif /* #ifndef _SWEDLL_H */
|
#endif /* #ifndef _SWEDLL_H */
|
||||||
|
|
||||||
|
1479
swe/src/swephlib.c
1479
swe/src/swephlib.c
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@
|
|||||||
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||||
|
|
||||||
License conditions
|
License conditions
|
||||||
@ -72,11 +73,13 @@
|
|||||||
#define PREC_SIMON_1994 FALSE
|
#define PREC_SIMON_1994 FALSE
|
||||||
#define PREC_LASKAR_1986 FALSE
|
#define PREC_LASKAR_1986 FALSE
|
||||||
#define PREC_BRETAGNON_2003 FALSE
|
#define PREC_BRETAGNON_2003 FALSE
|
||||||
|
|
||||||
/* IAU precession 1976 or 2003 for recent centuries.
|
/* IAU precession 1976 or 2003 for recent centuries.
|
||||||
* only one of the following two defines may be TRUE */
|
* only one of the following two defines may be TRUE */
|
||||||
#define PREC_IAU_1976 FALSE
|
#define PREC_IAU_1976 FALSE
|
||||||
#define PREC_IAU_2003 FALSE /* precession model P03 */
|
#define PREC_IAU_2003 FALSE /* precession model P03 */
|
||||||
#define PREC_IAU_1976_CTIES 2.0 /* J2000 +/- two centuries */
|
#define PREC_IAU_1976_CTIES 2.0 /* J2000 +/- two centuries */
|
||||||
|
|
||||||
/* we use P03 for whole ephemeris */
|
/* we use P03 for whole ephemeris */
|
||||||
#define PREC_IAU_2003_CTIES 75.0 /* J2000 +/- 75 centuries */
|
#define PREC_IAU_2003_CTIES 75.0 /* J2000 +/- 75 centuries */
|
||||||
|
|
||||||
@ -89,7 +92,8 @@
|
|||||||
extern void swi_coortrf(double *xpo, double *xpn, double eps);
|
extern void swi_coortrf(double *xpo, double *xpn, double eps);
|
||||||
|
|
||||||
/* coordinate transformation */
|
/* coordinate transformation */
|
||||||
extern void swi_coortrf2(double *xpo, double *xpn, double sineps, double coseps);
|
extern void swi_coortrf2(double *xpo, double *xpn, double sineps,
|
||||||
|
double coseps);
|
||||||
|
|
||||||
/* cartesian to polar coordinates */
|
/* cartesian to polar coordinates */
|
||||||
extern void swi_cartpol(double *x, double *l);
|
extern void swi_cartpol(double *x, double *l);
|
||||||
@ -103,21 +107,24 @@ extern void swi_polcart(double *l, double *x);
|
|||||||
|
|
||||||
/* GCRS to J2000 */
|
/* GCRS to J2000 */
|
||||||
extern void swi_bias(double *x, int32 iflag, AS_BOOL backward);
|
extern void swi_bias(double *x, int32 iflag, AS_BOOL backward);
|
||||||
|
|
||||||
/* GCRS to FK5 */
|
/* GCRS to FK5 */
|
||||||
extern void swi_icrs2fk5(double *x, int32 iflag, AS_BOOL backward);
|
extern void swi_icrs2fk5(double *x, int32 iflag, AS_BOOL backward);
|
||||||
|
|
||||||
/* precession */
|
/* precession */
|
||||||
extern int swi_precess(double *R, double J, int direction );
|
extern int swi_precess(double *R, double J, int direction);
|
||||||
extern void swi_precess_speed(double *xx, double t, int direction);
|
extern void swi_precess_speed(double *xx, double t, int direction);
|
||||||
|
|
||||||
/* from sweph.c, light deflection, aberration, etc. */
|
/* from sweph.c, light deflection, aberration, etc. */
|
||||||
extern void swi_deflect_light(double *xx, double dt, int32 iflag);
|
extern void swi_deflect_light(double *xx, double dt, int32 iflag);
|
||||||
extern void swi_aberr_light(double *xx, double *xe, int32 iflag);
|
extern void swi_aberr_light(double *xx, double *xe, int32 iflag);
|
||||||
extern int swi_plan_for_osc_elem(int32 iflag, double tjd, double *xx);
|
extern int swi_plan_for_osc_elem(int32 iflag, double tjd, double *xx);
|
||||||
extern int swi_trop_ra2sid_lon(double *xin, double *xout, double *xoutr, int32 iflag, char *serr);
|
extern int swi_trop_ra2sid_lon(double *xin, double *xout, double *xoutr,
|
||||||
extern int swi_trop_ra2sid_lon_sosy(double *xin, double *xout, double *xoutr, int32 iflag, char *serr);
|
int32 iflag, char *serr);
|
||||||
extern int swi_get_observer(double tjd, int32 iflag,
|
extern int swi_trop_ra2sid_lon_sosy(double *xin, double *xout, double *xoutr,
|
||||||
AS_BOOL do_save, double *xobs, char *serr);
|
int32 iflag, char *serr);
|
||||||
|
extern int swi_get_observer(double tjd, int32 iflag, AS_BOOL do_save,
|
||||||
|
double *xobs, char *serr);
|
||||||
extern void swi_force_app_pos_etc();
|
extern void swi_force_app_pos_etc();
|
||||||
|
|
||||||
/* obliquity of ecliptic */
|
/* obliquity of ecliptic */
|
||||||
@ -130,9 +137,9 @@ extern void swi_check_nutation(double tjd, int32 iflag);
|
|||||||
extern int swi_nutation(double J, double *nutlo);
|
extern int swi_nutation(double J, double *nutlo);
|
||||||
extern void swi_nutate(double *xx, int32 iflag, AS_BOOL backward);
|
extern void swi_nutate(double *xx, int32 iflag, AS_BOOL backward);
|
||||||
|
|
||||||
extern void swi_mean_lunar_elements(double tjd,
|
extern void swi_mean_lunar_elements(double tjd, double *node, double *dnode,
|
||||||
double *node, double *dnode,
|
|
||||||
double *peri, double *dperi);
|
double *peri, double *dperi);
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
extern double swi_mod2PI(double x);
|
extern double swi_mod2PI(double x);
|
||||||
|
|
||||||
@ -142,6 +149,7 @@ extern double swi_edcheb(double x, double *coef, int ncf);
|
|||||||
|
|
||||||
/* cross product of vectors */
|
/* cross product of vectors */
|
||||||
extern void swi_cross_prod(double *a, double *b, double *x);
|
extern void swi_cross_prod(double *a, double *b, double *x);
|
||||||
|
|
||||||
/* dot product of vecotrs */
|
/* dot product of vecotrs */
|
||||||
extern double swi_dot_prod_unit(double *x, double *y);
|
extern double swi_dot_prod_unit(double *x, double *y);
|
||||||
|
|
||||||
@ -166,14 +174,14 @@ extern char *swi_strcpy(char *to, char *from);
|
|||||||
extern char *swi_strncpy(char *to, char *from, size_t n);
|
extern char *swi_strncpy(char *to, char *from, size_t n);
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
# define TRACE_COUNT_MAX 10000
|
#define TRACE_COUNT_MAX 10000
|
||||||
extern FILE *swi_fp_trace_c;
|
extern FILE *swi_fp_trace_c;
|
||||||
extern FILE *swi_fp_trace_out;
|
extern FILE *swi_fp_trace_out;
|
||||||
extern void swi_open_trace(char *serr);
|
extern void swi_open_trace(char *serr);
|
||||||
extern int32 swi_trace_count;
|
extern int32 swi_trace_count;
|
||||||
static char *fname_trace_c = "swetrace.c";
|
static char *fname_trace_c = "swetrace.c";
|
||||||
static char *fname_trace_out = "swetrace.txt";
|
static char *fname_trace_out = "swetrace.txt";
|
||||||
#ifdef FORCE_IFLAG
|
#ifdef FORCE_IFLAG
|
||||||
static char *fname_force_flg = "force.flg";
|
static char *fname_force_flg = "force.flg";
|
||||||
#endif
|
#endif
|
||||||
#endif /* TRACE */
|
#endif /* TRACE */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user