| 1 |
/** |
|---|
| 2 |
* D bindings for AstroDienst Swiss Ephemeris library. |
|---|
| 3 |
* |
|---|
| 4 |
* Author: Stanislas Marquis <stnsls@gmail.com> |
|---|
| 5 |
* Swisseph version: 1.76.00 |
|---|
| 6 |
* Date: 03.06.2009 |
|---|
| 7 |
*/ |
|---|
| 8 |
|
|---|
| 9 |
module swisseph; |
|---|
| 10 |
|
|---|
| 11 |
extern (C): |
|---|
| 12 |
|
|---|
| 13 |
/************************************************************ |
|---|
| 14 |
$Header: /home/dieter/sweph/RCS/swephexp.h,v 1.74 2008/06/16 10:07:20 dieter Exp $ |
|---|
| 15 |
SWISSEPH: exported definitions and constants |
|---|
| 16 |
|
|---|
| 17 |
This file represents the standard application interface (API) |
|---|
| 18 |
to the Swiss Ephemeris. |
|---|
| 19 |
|
|---|
| 20 |
A C programmer needs only to include this file, and link his code |
|---|
| 21 |
with the SwissEph library. |
|---|
| 22 |
|
|---|
| 23 |
The function calls are documented in the Programmer's documentation, |
|---|
| 24 |
which is online in HTML format. |
|---|
| 25 |
|
|---|
| 26 |
Structure of this file: |
|---|
| 27 |
Public API definitions |
|---|
| 28 |
Internal developer's definitions |
|---|
| 29 |
Public API functions. |
|---|
| 30 |
|
|---|
| 31 |
Authors: Dieter Koch and Alois Treindl, Astrodienst ZÃŒrich |
|---|
| 32 |
|
|---|
| 33 |
************************************************************/ |
|---|
| 34 |
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved. |
|---|
| 35 |
|
|---|
| 36 |
License conditions |
|---|
| 37 |
------------------ |
|---|
| 38 |
|
|---|
| 39 |
This file is part of Swiss Ephemeris. |
|---|
| 40 |
|
|---|
| 41 |
Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author |
|---|
| 42 |
or distributor accepts any responsibility for the consequences of using it, |
|---|
| 43 |
or for whether it serves any particular purpose or works at all, unless he |
|---|
| 44 |
or she says so in writing. |
|---|
| 45 |
|
|---|
| 46 |
Swiss Ephemeris is made available by its authors under a dual licensing |
|---|
| 47 |
system. The software developer, who uses any part of Swiss Ephemeris |
|---|
| 48 |
in his or her software, must choose between one of the two license models, |
|---|
| 49 |
which are |
|---|
| 50 |
a) GNU public license version 2 or later |
|---|
| 51 |
b) Swiss Ephemeris Professional License |
|---|
| 52 |
|
|---|
| 53 |
The choice must be made before the software developer distributes software |
|---|
| 54 |
containing parts of Swiss Ephemeris to others, and before any public |
|---|
| 55 |
service using the developed software is activated. |
|---|
| 56 |
|
|---|
| 57 |
If the developer choses the GNU GPL software license, he or she must fulfill |
|---|
| 58 |
the conditions of that license, which includes the obligation to place his |
|---|
| 59 |
or her whole software project under the GNU GPL or a compatible license. |
|---|
| 60 |
See http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|---|
| 61 |
|
|---|
| 62 |
If the developer choses the Swiss Ephemeris Professional license, |
|---|
| 63 |
he must follow the instructions as found in http://www.astro.com/swisseph/ |
|---|
| 64 |
and purchase the Swiss Ephemeris Professional Edition from Astrodienst |
|---|
| 65 |
and sign the corresponding license contract. |
|---|
| 66 |
|
|---|
| 67 |
The License grants you the right to use, copy, modify and redistribute |
|---|
| 68 |
Swiss Ephemeris, but only under certain conditions described in the License. |
|---|
| 69 |
Among other things, the License requires that the copyright notices and |
|---|
| 70 |
this notice be preserved on all copies. |
|---|
| 71 |
|
|---|
| 72 |
Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl |
|---|
| 73 |
|
|---|
| 74 |
The authors of Swiss Ephemeris have no control or influence over any of |
|---|
| 75 |
the derived works, i.e. over software or services created by other |
|---|
| 76 |
programmers which use Swiss Ephemeris functions. |
|---|
| 77 |
|
|---|
| 78 |
The names of the authors or of the copyright holder (Astrodienst) must not |
|---|
| 79 |
be used for promoting any software, product or service which uses or contains |
|---|
| 80 |
the Swiss Ephemeris. This copyright notice is the ONLY place where the |
|---|
| 81 |
names of the authors can legally appear, except in cases where they have |
|---|
| 82 |
given special permission in writing. |
|---|
| 83 |
|
|---|
| 84 |
The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used |
|---|
| 85 |
for promoting such software, products or services. |
|---|
| 86 |
*/ |
|---|
| 87 |
|
|---|
| 88 |
/*********************************************************** |
|---|
| 89 |
* definitions for use also by non-C programmers |
|---|
| 90 |
***********************************************************/ |
|---|
| 91 |
|
|---|
| 92 |
/* values for gregflag in swe_julday() and swe_revjul() */ |
|---|
| 93 |
const SE_JUL_CAL = 0; |
|---|
| 94 |
const SE_GREG_CAL = 1; |
|---|
| 95 |
|
|---|
| 96 |
/* |
|---|
| 97 |
* planet numbers for the ipl parameter in swe_calc() |
|---|
| 98 |
*/ |
|---|
| 99 |
const SE_ECL_NUT = -1; |
|---|
| 100 |
|
|---|
| 101 |
const SE_SUN = 0; |
|---|
| 102 |
const SE_MOON = 1; |
|---|
| 103 |
const SE_MERCURY = 2; |
|---|
| 104 |
const SE_VENUS = 3; |
|---|
| 105 |
const SE_MARS = 4; |
|---|
| 106 |
const SE_JUPITER = 5; |
|---|
| 107 |
const SE_SATURN = 6; |
|---|
| 108 |
const SE_URANUS = 7; |
|---|
| 109 |
const SE_NEPTUNE = 8; |
|---|
| 110 |
const SE_PLUTO = 9; |
|---|
| 111 |
const SE_MEAN_NODE = 10; |
|---|
| 112 |
const SE_TRUE_NODE = 11; |
|---|
| 113 |
const SE_MEAN_APOG = 12; |
|---|
| 114 |
const SE_OSCU_APOG = 13; |
|---|
| 115 |
const SE_EARTH = 14; |
|---|
| 116 |
const SE_CHIRON = 15; |
|---|
| 117 |
const SE_PHOLUS = 16; |
|---|
| 118 |
const SE_CERES = 17; |
|---|
| 119 |
const SE_PALLAS = 18; |
|---|
| 120 |
const SE_JUNO = 19; |
|---|
| 121 |
const SE_VESTA = 20; |
|---|
| 122 |
const SE_INTP_APOG = 21; |
|---|
| 123 |
const SE_INTP_PERG = 22; |
|---|
| 124 |
|
|---|
| 125 |
const SE_NPLANETS = 23; |
|---|
| 126 |
|
|---|
| 127 |
const SE_AST_OFFSET = 10000; |
|---|
| 128 |
const SE_VARUNA = SE_AST_OFFSET + 20000; |
|---|
| 129 |
|
|---|
| 130 |
const SE_FICT_OFFSET = 40; |
|---|
| 131 |
const SE_FICT_OFFSET_1 = 39; |
|---|
| 132 |
const SE_FICT_MAX = 999; |
|---|
| 133 |
const SE_NFICT_ELEM = 15; |
|---|
| 134 |
|
|---|
| 135 |
const SE_COMET_OFFSET = 1000; |
|---|
| 136 |
|
|---|
| 137 |
const SE_NALL_NAT_POINTS = SE_NPLANETS + SE_NFICT_ELEM; |
|---|
| 138 |
|
|---|
| 139 |
/* Hamburger or Uranian "planets" */ |
|---|
| 140 |
const SE_CUPIDO = 40; |
|---|
| 141 |
const SE_HADES = 41; |
|---|
| 142 |
const SE_ZEUS = 42; |
|---|
| 143 |
const SE_KRONOS = 43; |
|---|
| 144 |
const SE_APOLLON = 44; |
|---|
| 145 |
const SE_ADMETOS = 45; |
|---|
| 146 |
const SE_VULKANUS = 46; |
|---|
| 147 |
const SE_POSEIDON = 47; |
|---|
| 148 |
/* other fictitious bodies */ |
|---|
| 149 |
const SE_ISIS = 48; |
|---|
| 150 |
const SE_NIBIRU = 49; |
|---|
| 151 |
const SE_HARRINGTON = 50; |
|---|
| 152 |
const SE_NEPTUNE_LEVERRIER = 51; |
|---|
| 153 |
const SE_NEPTUNE_ADAMS = 52; |
|---|
| 154 |
const SE_PLUTO_LOWELL = 53; |
|---|
| 155 |
const SE_PLUTO_PICKERING = 54; |
|---|
| 156 |
const SE_VULCAN = 55; |
|---|
| 157 |
const SE_WHITE_MOON = 56; |
|---|
| 158 |
const SE_PROSERPINA = 57; |
|---|
| 159 |
const SE_WALDEMATH = 58; |
|---|
| 160 |
|
|---|
| 161 |
const SE_FIXSTAR = -10; |
|---|
| 162 |
|
|---|
| 163 |
const SE_ASC = 0; |
|---|
| 164 |
const SE_MC = 1; |
|---|
| 165 |
const SE_ARMC = 2; |
|---|
| 166 |
const SE_VERTEX = 3; |
|---|
| 167 |
const SE_EQUASC = 4; /* "equatorial ascendant" */ |
|---|
| 168 |
const SE_COASC1 = 5; /* "co-ascendant" (W. Koch) */ |
|---|
| 169 |
const SE_COASC2 = 6; /* "co-ascendant" (M. Munkasey) */ |
|---|
| 170 |
const SE_POLASC = 7; /* "polar ascendant" (M. Munkasey) */ |
|---|
| 171 |
const SE_NASCMC = 8; |
|---|
| 172 |
|
|---|
| 173 |
/* |
|---|
| 174 |
* flag bits for parameter iflag in function swe_calc() |
|---|
| 175 |
* The flag bits are defined in such a way that iflag = 0 delivers what one |
|---|
| 176 |
* usually wants: |
|---|
| 177 |
* - the default ephemeris (SWISS EPHEMERIS) is used, |
|---|
| 178 |
* - apparent geocentric positions referring to the true equinox of date |
|---|
| 179 |
* are returned. |
|---|
| 180 |
* If not only coordinates, but also speed values are required, use |
|---|
| 181 |
* flag = SEFLG_SPEED. |
|---|
| 182 |
* |
|---|
| 183 |
* The 'L' behind the number indicates that 32-bit integers (Long) are used. |
|---|
| 184 |
*/ |
|---|
| 185 |
const SEFLG_JPLEPH = 1; /* use JPL ephemeris */ |
|---|
| 186 |
const SEFLG_SWIEPH = 2; /* use SWISSEPH ephemeris */ |
|---|
| 187 |
const SEFLG_MOSEPH = 4; /* use Moshier ephemeris */ |
|---|
| 188 |
|
|---|
| 189 |
const SEFLG_HELCTR = 8; /* return heliocentric position */ |
|---|
| 190 |
const SEFLG_TRUEPOS = 16; /* return true positions, not apparent */ |
|---|
| 191 |
const SEFLG_J2000 = 32; /* no precession, i.e. give J2000 equinox */ |
|---|
| 192 |
const SEFLG_NONUT = 64; /* no nutation, i.e. mean equinox of date */ |
|---|
| 193 |
const SEFLG_SPEED3 = 128; /* speed from 3 positions (do not use it, |
|---|
| 194 |
SEFLG_SPEED is faster and more precise.) */ |
|---|
| 195 |
const SEFLG_SPEED = 256; /* high precision speed */ |
|---|
| 196 |
const SEFLG_NOGDEFL = 512; /* turn off gravitational deflection */ |
|---|
| 197 |
const SEFLG_NOABERR = 1024; /* turn off 'annual' aberration of light */ |
|---|
| 198 |
const SEFLG_EQUATORIAL = (2*1024); /* equatorial positions are wanted */ |
|---|
| 199 |
const SEFLG_XYZ = (4*1024); /* cartesian, not polar, coordinates */ |
|---|
| 200 |
const SEFLG_RADIANS = (8*1024); /* coordinates in radians, not degrees */ |
|---|
| 201 |
const SEFLG_BARYCTR = (16*1024); /* barycentric positions */ |
|---|
| 202 |
const SEFLG_TOPOCTR = (32*1024); /* topocentric positions */ |
|---|
| 203 |
const SEFLG_SIDEREAL = (64*1024); /* sidereal positions */ |
|---|
| 204 |
const SEFLG_ICRS = (128*1024); /* ICRS (DE406 reference frame) */ |
|---|
| 205 |
|
|---|
| 206 |
const SE_SIDBITS = 256; |
|---|
| 207 |
/* for projection onto ecliptic of t0 */ |
|---|
| 208 |
const SE_SIDBIT_ECL_T0 = 256; |
|---|
| 209 |
/* for projection onto solar system plane */ |
|---|
| 210 |
const SE_SIDBIT_SSY_PLANE = 512; |
|---|
| 211 |
|
|---|
| 212 |
/* sidereal modes (ayanamsas) */ |
|---|
| 213 |
const SE_SIDM_FAGAN_BRADLEY = 0; |
|---|
| 214 |
const SE_SIDM_LAHIRI = 1; |
|---|
| 215 |
const SE_SIDM_DELUCE = 2; |
|---|
| 216 |
const SE_SIDM_RAMAN = 3; |
|---|
| 217 |
const SE_SIDM_USHASHASHI = 4; |
|---|
| 218 |
const SE_SIDM_KRISHNAMURTI = 5; |
|---|
| 219 |
const SE_SIDM_DJWHAL_KHUL = 6; |
|---|
| 220 |
const SE_SIDM_YUKTESHWAR = 7; |
|---|
| 221 |
const SE_SIDM_JN_BHASIN = 8; |
|---|
| 222 |
const SE_SIDM_BABYL_KUGLER1 = 9; |
|---|
| 223 |
const SE_SIDM_BABYL_KUGLER2 = 10; |
|---|
| 224 |
const SE_SIDM_BABYL_KUGLER3 = 11; |
|---|
| 225 |
const SE_SIDM_BABYL_HUBER = 12; |
|---|
| 226 |
const SE_SIDM_BABYL_ETPSC = 13; |
|---|
| 227 |
const SE_SIDM_ALDEBARAN_15TAU = 14; |
|---|
| 228 |
const SE_SIDM_HIPPARCHOS = 15; |
|---|
| 229 |
const SE_SIDM_SASSANIAN = 16; |
|---|
| 230 |
const SE_SIDM_GALCENT_0SAG = 17; |
|---|
| 231 |
const SE_SIDM_J2000 = 18; |
|---|
| 232 |
const SE_SIDM_J1900 = 19; |
|---|
| 233 |
const SE_SIDM_B1950 = 20; |
|---|
| 234 |
const SE_SIDM_USER = 255; |
|---|
| 235 |
|
|---|
| 236 |
const SE_NSIDM_PREDEF = 21; |
|---|
| 237 |
|
|---|
| 238 |
/* used for swe_nod_aps(): */ |
|---|
| 239 |
const SE_NODBIT_MEAN = 1; /* mean nodes/apsides */ |
|---|
| 240 |
const SE_NODBIT_OSCU = 2; /* osculating nodes/apsides */ |
|---|
| 241 |
const SE_NODBIT_OSCU_BAR = 4; /* same, but motion about solar system barycenter is considered */ |
|---|
| 242 |
const SE_NODBIT_FOPOINT = 256; /* focal point of orbit instead of aphelion */ |
|---|
| 243 |
|
|---|
| 244 |
/* default ephemeris used when no ephemeris flagbit is set */ |
|---|
| 245 |
const SEFLG_DEFAULTEPH = SEFLG_SWIEPH; |
|---|
| 246 |
|
|---|
| 247 |
const SE_MAX_STNAME = 256; /* maximum size of fixstar name; |
|---|
| 248 |
* the parameter star in swe_fixstar |
|---|
| 249 |
* must allow twice this space for |
|---|
| 250 |
* the returned star name. |
|---|
| 251 |
*/ |
|---|
| 252 |
|
|---|
| 253 |
/* defines for eclipse computations */ |
|---|
| 254 |
|
|---|
| 255 |
const SE_ECL_CENTRAL = 1; |
|---|
| 256 |
const SE_ECL_NONCENTRAL = 2; |
|---|
| 257 |
const SE_ECL_TOTAL = 4; |
|---|
| 258 |
const SE_ECL_ANNULAR = 8; |
|---|
| 259 |
const SE_ECL_PARTIAL = 16; |
|---|
| 260 |
const SE_ECL_ANNULAR_TOTAL = 32; |
|---|
| 261 |
const SE_ECL_PENUMBRAL = 64; |
|---|
| 262 |
const SE_ECL_ALLTYPES_SOLAR = (SE_ECL_CENTRAL|SE_ECL_NONCENTRAL|SE_ECL_TOTAL|SE_ECL_ANNULAR|SE_ECL_PARTIAL|SE_ECL_ANNULAR_TOTAL); |
|---|
| 263 |
const SE_ECL_ALLTYPES_LUNAR = (SE_ECL_TOTAL|SE_ECL_PARTIAL|SE_ECL_PENUMBRAL); |
|---|
| 264 |
const SE_ECL_VISIBLE = 128; |
|---|
| 265 |
const SE_ECL_MAX_VISIBLE = 256; |
|---|
| 266 |
const SE_ECL_1ST_VISIBLE = 512; |
|---|
| 267 |
const SE_ECL_2ND_VISIBLE = 1024; |
|---|
| 268 |
const SE_ECL_3RD_VISIBLE = 2048; |
|---|
| 269 |
const SE_ECL_4TH_VISIBLE = 4096; |
|---|
| 270 |
const SE_ECL_ONE_TRY = (32*1024); |
|---|
| 271 |
/* check if the next conjunction of the moon with |
|---|
| 272 |
* a planet is an occultation; don't search further */ |
|---|
| 273 |
|
|---|
| 274 |
/* for swe_rise_transit() */ |
|---|
| 275 |
const SE_CALC_RISE = 1; |
|---|
| 276 |
const SE_CALC_SET = 2; |
|---|
| 277 |
const SE_CALC_MTRANSIT = 4; |
|---|
| 278 |
const SE_CALC_ITRANSIT = 8; |
|---|
| 279 |
const SE_BIT_DISC_CENTER = 256; /* to be or'ed to SE_CALC_RISE/SET */ |
|---|
| 280 |
/* if rise or set of disc center is */ |
|---|
| 281 |
/* required */ |
|---|
| 282 |
const SE_BIT_NO_REFRACTION = 512; /* to be or'ed to SE_CALC_RISE/SET, */ |
|---|
| 283 |
/* if refraction is not to be considered */ |
|---|
| 284 |
const SE_BIT_CIVIL_TWILIGHT = 1024; /* to be or'ed to SE_CALC_RISE/SET */ |
|---|
| 285 |
const SE_BIT_NAUTIC_TWILIGHT = 2048; /* to be or'ed to SE_CALC_RISE/SET */ |
|---|
| 286 |
const SE_BIT_ASTRO_TWILIGHT = 4096; /* to be or'ed to SE_CALC_RISE/SET */ |
|---|
| 287 |
|
|---|
| 288 |
|
|---|
| 289 |
/* for swe_azalt() and swe_azalt_rev() */ |
|---|
| 290 |
const SE_ECL2HOR = 0; |
|---|
| 291 |
const SE_EQU2HOR = 1; |
|---|
| 292 |
const SE_HOR2ECL = 0; |
|---|
| 293 |
const SE_HOR2EQU = 1; |
|---|
| 294 |
|
|---|
| 295 |
/* for swe_refrac() */ |
|---|
| 296 |
const SE_TRUE_TO_APP = 0; |
|---|
| 297 |
const SE_APP_TO_TRUE = 1; |
|---|
| 298 |
|
|---|
| 299 |
/* |
|---|
| 300 |
* only used for experimenting with various JPL ephemeris files |
|---|
| 301 |
* which are available at Astrodienst's internal network |
|---|
| 302 |
*/ |
|---|
| 303 |
const SE_DE_NUMBER = 406; |
|---|
| 304 |
const char[] SE_FNAME_DE200 = "de200.eph"; |
|---|
| 305 |
const char[] SE_FNAME_DE403 = "de403.eph"; |
|---|
| 306 |
const char[] SE_FNAME_DE404 = "de404.eph"; |
|---|
| 307 |
const char[] SE_FNAME_DE405 = "de405.eph"; |
|---|
| 308 |
const char[] SE_FNAME_DE406 = "de406.eph"; |
|---|
| 309 |
const char[] SE_FNAME_DFT = SE_FNAME_DE406; |
|---|
| 310 |
const char[] SE_STARFILE = "fixstars.cat"; |
|---|
| 311 |
const char[] SE_ASTNAMFILE = "seasnam.txt"; |
|---|
| 312 |
const char[] SE_FICTFILE = "seorbel.txt"; |
|---|
| 313 |
|
|---|
| 314 |
/* |
|---|
| 315 |
* ephemeris path |
|---|
| 316 |
* this defines where ephemeris files are expected if the function |
|---|
| 317 |
* swe_set_ephe_path() is not called by the application. |
|---|
| 318 |
* Normally, every application should make this call to define its |
|---|
| 319 |
* own place for the ephemeris files. |
|---|
| 320 |
*/ |
|---|
| 321 |
|
|---|
| 322 |
version ( Windows ) |
|---|
| 323 |
{ |
|---|
| 324 |
version( PAIR_SWEPH ) |
|---|
| 325 |
{ |
|---|
| 326 |
const char[] SE_EPHE_PATH = "\\pair\\ephe\\"; |
|---|
| 327 |
} |
|---|
| 328 |
else |
|---|
| 329 |
{ |
|---|
| 330 |
const char[] SE_EPHE_PATH = "\\sweph\\ephe\\"; |
|---|
| 331 |
} |
|---|
| 332 |
} |
|---|
| 333 |
version ( OSX ) |
|---|
| 334 |
{ |
|---|
| 335 |
const char[] SE_EPHE_PATH = ":ephe:"; |
|---|
| 336 |
} |
|---|
| 337 |
version ( linux ) |
|---|
| 338 |
{ |
|---|
| 339 |
const char[] SE_EPHE_PATH = ".:/usr/share/swisseph/:/usr/local/share/swisseph/"; |
|---|
| 340 |
} |
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
/* defines for function swe_split_deg() (in swephlib.c) */ |
|---|
| 344 |
const SE_SPLIT_DEG_ROUND_SEC = 1; |
|---|
| 345 |
const SE_SPLIT_DEG_ROUND_MIN = 2; |
|---|
| 346 |
const SE_SPLIT_DEG_ROUND_DEG = 4; |
|---|
| 347 |
const SE_SPLIT_DEG_ZODIACAL = 8; |
|---|
| 348 |
const SE_SPLIT_DEG_KEEP_SIGN = 16; /* don't round to next sign, |
|---|
| 349 |
* e.g. 29.9999999 will be rounded |
|---|
| 350 |
* to 29°59'59" (or 29°59' or 29°) */ |
|---|
| 351 |
const SE_SPLIT_DEG_KEEP_DEG = 32; /* don't round to next degree |
|---|
| 352 |
* e.g. 13.9999999 will be rounded |
|---|
| 353 |
* to 13°59'59" (or 13°59' or 13°) */ |
|---|
| 354 |
|
|---|
| 355 |
/* for heliacal functions */ |
|---|
| 356 |
const SE_HELIACAL_RISING = 1; |
|---|
| 357 |
const SE_HELIACAL_SETTING = 2; |
|---|
| 358 |
const SE_MORNING_FIRST = SE_HELIACAL_RISING; |
|---|
| 359 |
const SE_EVENING_LAST = SE_HELIACAL_SETTING; |
|---|
| 360 |
const SE_EVENING_FIRST = 3; |
|---|
| 361 |
const SE_MORNING_LAST = 4; |
|---|
| 362 |
const SE_ACRONYCHAL_RISING = 5; /* still not implemented */ |
|---|
| 363 |
const SE_COSMICAL_SETTING = 6; /* still not implemented */ |
|---|
| 364 |
const SE_ACRONYCHAL_SETTING = SE_COSMICAL_SETTING; |
|---|
| 365 |
|
|---|
| 366 |
const SE_HELFLAG_LONG_SEARCH = 128; |
|---|
| 367 |
const SE_HELFLAG_HIGH_PRECISION = 256; |
|---|
| 368 |
const SE_HELFLAG_OPTICAL_PARAMS = 512; |
|---|
| 369 |
const SE_HELFLAG_NO_DETAILS = 1024; |
|---|
| 370 |
const SE_HELFLAG_AVKIND_VR = 2048; |
|---|
| 371 |
const SE_HELFLAG_AVKIND_PTO = 4096; |
|---|
| 372 |
const SE_HELFLAG_AVKIND_MIN7 = 8192; |
|---|
| 373 |
const SE_HELFLAG_AVKIND_MIN9 = 16384; |
|---|
| 374 |
const SE_HELFLAG_AVKIND = (SE_HELFLAG_AVKIND_VR|SE_HELFLAG_AVKIND_PTO|SE_HELFLAG_AVKIND_MIN7|SE_HELFLAG_AVKIND_MIN9); |
|---|
| 375 |
const TJD_INVALID = 99999999.0; |
|---|
| 376 |
const SIMULATE_VICTORVB = 1; |
|---|
| 377 |
|
|---|
| 378 |
const SE_PHOTOPIC_FLAG = 0; |
|---|
| 379 |
const SE_SCOTOPIC_FLAG = 1; |
|---|
| 380 |
const SE_MIXEDOPIC_FLAG = 2; |
|---|
| 381 |
|
|---|
| 382 |
/* |
|---|
| 383 |
* by compiling with -DPAIR_SWEPH in the compiler options it |
|---|
| 384 |
* is possible to create a more compact version of SwissEph which |
|---|
| 385 |
* contains no code for the JPL ephemeris file and for the builtin |
|---|
| 386 |
* Moshier ephemeris. |
|---|
| 387 |
* This is quite useful for MSDOS real mode applications which need to |
|---|
| 388 |
* run within 640 kb. |
|---|
| 389 |
* The option is called PAIR_SWEPH because it was introduced for |
|---|
| 390 |
* Astrodienst's partner software PAIR. |
|---|
| 391 |
*/ |
|---|
| 392 |
version ( PAIR_SWEPH ) |
|---|
| 393 |
{ |
|---|
| 394 |
const bool NO_JPL = true; |
|---|
| 395 |
} |
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 |
/*********************************************************** |
|---|
| 400 |
* exported functions |
|---|
| 401 |
***********************************************************/ |
|---|
| 402 |
|
|---|
| 403 |
int swe_heliacal_ut(double tjdstart_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int TypeEvent, int iflag, double *dret, char *serr); |
|---|
| 404 |
int swe_heliacal_pheno_ut(double tjd_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int TypeEvent, int helflag, double *darr, char *serr); |
|---|
| 405 |
int swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int helflag, double *dret, char *serr); |
|---|
| 406 |
/* the following are secret, for Victor Reijs' */ |
|---|
| 407 |
int swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr); |
|---|
| 408 |
int swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr); |
|---|
| 409 |
|
|---|
| 410 |
/**************************** |
|---|
| 411 |
* exports from sweph.c |
|---|
| 412 |
****************************/ |
|---|
| 413 |
|
|---|
| 414 |
char* swe_version(char *); |
|---|
| 415 |
|
|---|
| 416 |
/* planets, moon, nodes etc. */ |
|---|
| 417 |
int swe_calc( |
|---|
| 418 |
double tjd, int ipl, int iflag, |
|---|
| 419 |
double *xx, |
|---|
| 420 |
char *serr); |
|---|
| 421 |
|
|---|
| 422 |
int swe_calc_ut(double tjd_ut, int ipl, int iflag, |
|---|
| 423 |
double *xx, char *serr); |
|---|
| 424 |
|
|---|
| 425 |
/* fixed stars */ |
|---|
| 426 |
int swe_fixstar( |
|---|
| 427 |
char *star, double tjd, int iflag, |
|---|
| 428 |
double *xx, |
|---|
| 429 |
char *serr); |
|---|
| 430 |
|
|---|
| 431 |
int swe_fixstar_ut(char *star, double tjd_ut, int iflag, |
|---|
| 432 |
double *xx, char *serr); |
|---|
| 433 |
|
|---|
| 434 |
int swe_fixstar_mag(char *star, double *mag, char *serr); |
|---|
| 435 |
|
|---|
| 436 |
/* close Swiss Ephemeris */ |
|---|
| 437 |
void swe_close(); |
|---|
| 438 |
|
|---|
| 439 |
/* set directory path of ephemeris files */ |
|---|
| 440 |
void swe_set_ephe_path(char *path); |
|---|
| 441 |
|
|---|
| 442 |
/* set file name of JPL file */ |
|---|
| 443 |
void swe_set_jpl_file(char *fname); |
|---|
| 444 |
|
|---|
| 445 |
/* get planet name */ |
|---|
| 446 |
char* swe_get_planet_name(int ipl, char *spname); |
|---|
| 447 |
|
|---|
| 448 |
/* set geographic position of observer */ |
|---|
| 449 |
void swe_set_topo(double geolon, double geolat, double geoalt); |
|---|
| 450 |
|
|---|
| 451 |
/* set sidereal mode */ |
|---|
| 452 |
void swe_set_sid_mode(int sid_mode, double t0, double ayan_t0); |
|---|
| 453 |
|
|---|
| 454 |
/* get ayanamsa */ |
|---|
| 455 |
double swe_get_ayanamsa(double tjd_et); |
|---|
| 456 |
|
|---|
| 457 |
double swe_get_ayanamsa_ut(double tjd_ut); |
|---|
| 458 |
|
|---|
| 459 |
char* swe_get_ayanamsa_name(int isidmode); |
|---|
| 460 |
|
|---|
| 461 |
/**************************** |
|---|
| 462 |
* exports from swedate.c |
|---|
| 463 |
****************************/ |
|---|
| 464 |
|
|---|
| 465 |
int swe_date_conversion( |
|---|
| 466 |
int y , int m , int d , /* year, month, day */ |
|---|
| 467 |
double utime, /* universal time in hours (decimal) */ |
|---|
| 468 |
char c, /* calendar g[regorian]|j[ulian] */ |
|---|
| 469 |
double *tjd); |
|---|
| 470 |
|
|---|
| 471 |
double swe_julday( |
|---|
| 472 |
int year, int month, int day, double hour, |
|---|
| 473 |
int gregflag); |
|---|
| 474 |
|
|---|
| 475 |
void swe_revjul ( |
|---|
| 476 |
double jd, |
|---|
| 477 |
int gregflag, |
|---|
| 478 |
int *jyear, int *jmon, int *jday, double *jut); |
|---|
| 479 |
|
|---|
| 480 |
int swe_utc_to_jd( |
|---|
| 481 |
int iyear, int imonth, int iday, |
|---|
| 482 |
int ihour, int imin, double dsec, |
|---|
| 483 |
int gregflag, double *dret, char *serr); |
|---|
| 484 |
|
|---|
| 485 |
void swe_jdet_to_utc( |
|---|
| 486 |
double tjd_et, int gregflag, |
|---|
| 487 |
int *iyear, int *imonth, int *iday, |
|---|
| 488 |
int *ihour, int *imin, double *dsec); |
|---|
| 489 |
|
|---|
| 490 |
void swe_jdut1_to_utc( |
|---|
| 491 |
double tjd_ut, int gregflag, |
|---|
| 492 |
int *iyear, int *imonth, int *iday, |
|---|
| 493 |
int *ihour, int *imin, double *dsec); |
|---|
| 494 |
|
|---|
| 495 |
/**************************** |
|---|
| 496 |
* exports from swehouse.c |
|---|
| 497 |
****************************/ |
|---|
| 498 |
|
|---|
| 499 |
int swe_houses( |
|---|
| 500 |
double tjd_ut, double geolat, double geolon, int hsys, |
|---|
| 501 |
double *cusps, double *ascmc); |
|---|
| 502 |
|
|---|
| 503 |
int swe_houses_ex( |
|---|
| 504 |
double tjd_ut, int iflag, double geolat, double geolon, int hsys, |
|---|
| 505 |
double *cusps, double *ascmc); |
|---|
| 506 |
|
|---|
| 507 |
int swe_houses_armc( |
|---|
| 508 |
double armc, double geolat, double eps, int hsys, |
|---|
| 509 |
double *cusps, double *ascmc); |
|---|
| 510 |
|
|---|
| 511 |
double swe_house_pos( |
|---|
| 512 |
double armc, double geolat, double eps, int hsys, double *xpin, char *serr); |
|---|
| 513 |
|
|---|
| 514 |
/**************************** |
|---|
| 515 |
* exports from swecl.c |
|---|
| 516 |
****************************/ |
|---|
| 517 |
|
|---|
| 518 |
int swe_gauquelin_sector(double t_ut, int ipl, char *starname, int iflag, int imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr); |
|---|
| 519 |
|
|---|
| 520 |
/* computes geographic location and attributes of solar |
|---|
| 521 |
* eclipse at a given tjd */ |
|---|
| 522 |
int swe_sol_eclipse_where(double tjd, int ifl, double *geopos, double *attr, char *serr); |
|---|
| 523 |
|
|---|
| 524 |
int swe_lun_occult_where(double tjd, int ipl, char *starname, int ifl, double *geopos, double *attr, char *serr); |
|---|
| 525 |
|
|---|
| 526 |
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */ |
|---|
| 527 |
int swe_sol_eclipse_how(double tjd, int ifl, double *geopos, double *attr, char *serr); |
|---|
| 528 |
|
|---|
| 529 |
/* finds time of next local eclipse */ |
|---|
| 530 |
int swe_sol_eclipse_when_loc(double tjd_start, int ifl, double *geopos, double *tret, double *attr, int backward, char *serr); |
|---|
| 531 |
|
|---|
| 532 |
int swe_lun_occult_when_loc(double tjd_start, int ipl, char *starname, int ifl, |
|---|
| 533 |
double *geopos, double *tret, double *attr, int backward, char *serr); |
|---|
| 534 |
|
|---|
| 535 |
/* finds time of next eclipse globally */ |
|---|
| 536 |
int swe_sol_eclipse_when_glob(double tjd_start, int ifl, int ifltype, |
|---|
| 537 |
double *tret, int backward, char *serr); |
|---|
| 538 |
|
|---|
| 539 |
/* finds time of next occultation globally */ |
|---|
| 540 |
int swe_lun_occult_when_glob(double tjd_start, int ipl, char *starname, int ifl, int ifltype, |
|---|
| 541 |
double *tret, int backward, char *serr); |
|---|
| 542 |
|
|---|
| 543 |
/* computes attributes of a lunar eclipse for given tjd */ |
|---|
| 544 |
int swe_lun_eclipse_how( |
|---|
| 545 |
double tjd_ut, |
|---|
| 546 |
int ifl, |
|---|
| 547 |
double *geopos, |
|---|
| 548 |
double *attr, |
|---|
| 549 |
char *serr); |
|---|
| 550 |
|
|---|
| 551 |
int swe_lun_eclipse_when(double tjd_start, int ifl, int ifltype, |
|---|
| 552 |
double *tret, int backward, char *serr); |
|---|
| 553 |
|
|---|
| 554 |
/* planetary phenomena */ |
|---|
| 555 |
int swe_pheno(double tjd, int ipl, int iflag, double *attr, char *serr); |
|---|
| 556 |
|
|---|
| 557 |
int swe_pheno_ut(double tjd_ut, int ipl, int iflag, double *attr, char *serr); |
|---|
| 558 |
|
|---|
| 559 |
double swe_refrac(double inalt, double atpress, double attemp, int calc_flag); |
|---|
| 560 |
|
|---|
| 561 |
double swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int calc_flag, double *dret); |
|---|
| 562 |
|
|---|
| 563 |
void swe_set_lapse_rate(double lapse_rate); |
|---|
| 564 |
|
|---|
| 565 |
void swe_azalt( |
|---|
| 566 |
double tjd_ut, |
|---|
| 567 |
int calc_flag, |
|---|
| 568 |
double *geopos, |
|---|
| 569 |
double atpress, |
|---|
| 570 |
double attemp, |
|---|
| 571 |
double *xin, |
|---|
| 572 |
double *xaz); |
|---|
| 573 |
|
|---|
| 574 |
void swe_azalt_rev( |
|---|
| 575 |
double tjd_ut, |
|---|
| 576 |
int calc_flag, |
|---|
| 577 |
double *geopos, |
|---|
| 578 |
double *xin, |
|---|
| 579 |
double *xout); |
|---|
| 580 |
|
|---|
| 581 |
int swe_rise_trans( |
|---|
| 582 |
double tjd_ut, int ipl, char *starname, |
|---|
| 583 |
int epheflag, int rsmi, |
|---|
| 584 |
double *geopos, |
|---|
| 585 |
double atpress, double attemp, |
|---|
| 586 |
double *tret, |
|---|
| 587 |
char *serr); |
|---|
| 588 |
|
|---|
| 589 |
int swe_nod_aps(double tjd_et, int ipl, int iflag, |
|---|
| 590 |
int method, |
|---|
| 591 |
double *xnasc, double *xndsc, |
|---|
| 592 |
double *xperi, double *xaphe, |
|---|
| 593 |
char *serr); |
|---|
| 594 |
|
|---|
| 595 |
int swe_nod_aps_ut(double tjd_ut, int ipl, int iflag, |
|---|
| 596 |
int method, |
|---|
| 597 |
double *xnasc, double *xndsc, |
|---|
| 598 |
double *xperi, double *xaphe, |
|---|
| 599 |
char *serr); |
|---|
| 600 |
|
|---|
| 601 |
|
|---|
| 602 |
/**************************** |
|---|
| 603 |
* exports from swephlib.c |
|---|
| 604 |
****************************/ |
|---|
| 605 |
|
|---|
| 606 |
/* delta t */ |
|---|
| 607 |
double swe_deltat(double tjd); |
|---|
| 608 |
|
|---|
| 609 |
/* equation of time */ |
|---|
| 610 |
int swe_time_equ(double tjd, double *te, char *serr); |
|---|
| 611 |
|
|---|
| 612 |
/* sidereal time */ |
|---|
| 613 |
double swe_sidtime0(double tjd_ut, double eps, double nut); |
|---|
| 614 |
double swe_sidtime(double tjd_ut); |
|---|
| 615 |
|
|---|
| 616 |
/* coordinate transformation polar -> polar */ |
|---|
| 617 |
void swe_cotrans(double *xpo, double *xpn, double eps); |
|---|
| 618 |
void swe_cotrans_sp(double *xpo, double *xpn, double eps); |
|---|
| 619 |
|
|---|
| 620 |
/* tidal acceleration to be used in swe_deltat() */ |
|---|
| 621 |
double swe_get_tid_acc(); |
|---|
| 622 |
void swe_set_tid_acc(double t_acc); |
|---|
| 623 |
|
|---|
| 624 |
double swe_degnorm(double x); |
|---|
| 625 |
double swe_radnorm(double x); |
|---|
| 626 |
double swe_rad_midp(double x1, double x0); |
|---|
| 627 |
double swe_deg_midp(double x1, double x0); |
|---|
| 628 |
|
|---|
| 629 |
void swe_split_deg(double ddeg, int roundflag, int *ideg, int *imin, int *isec, double *dsecfr, int *isgn); |
|---|
| 630 |
|
|---|
| 631 |
/******************************************************* |
|---|
| 632 |
* other functions from swephlib.c; |
|---|
| 633 |
* they are not needed for Swiss Ephemeris, |
|---|
| 634 |
* but may be useful to former Placalc users. |
|---|
| 635 |
********************************************************/ |
|---|
| 636 |
|
|---|
| 637 |
/* normalize argument into interval [0..DEG360] */ |
|---|
| 638 |
int swe_csnorm(int p); |
|---|
| 639 |
|
|---|
| 640 |
/* distance in centisecs p1 - p2 normalized to [0..360[ */ |
|---|
| 641 |
int swe_difcsn (int p1, int p2); |
|---|
| 642 |
|
|---|
| 643 |
double swe_difdegn (double p1, double p2); |
|---|
| 644 |
|
|---|
| 645 |
/* distance in centisecs p1 - p2 normalized to [-180..180[ */ |
|---|
| 646 |
int swe_difcs2n(int p1, int p2); |
|---|
| 647 |
|
|---|
| 648 |
double swe_difdeg2n(double p1, double p2); |
|---|
| 649 |
double swe_difrad2n(double p1, double p2); |
|---|
| 650 |
|
|---|
| 651 |
/* round second, but at 29.5959 always down */ |
|---|
| 652 |
int swe_csroundsec(int x); |
|---|
| 653 |
|
|---|
| 654 |
/* double to int with rounding, no overflow check */ |
|---|
| 655 |
int swe_d2l(double x); |
|---|
| 656 |
|
|---|
| 657 |
/* monday = 0, ... sunday = 6 */ |
|---|
| 658 |
int swe_day_of_week(double jd); |
|---|
| 659 |
|
|---|
| 660 |
char* swe_cs2timestr(int t, int sep, int suppressZero, char *a); |
|---|
| 661 |
|
|---|
| 662 |
char* swe_cs2lonlatstr(int t, char pchar, char mchar, char *s); |
|---|
| 663 |
|
|---|
| 664 |
char* swe_cs2degstr(int t, char *a); |
|---|