Changeset 1719 in Sophya for trunk/SophyaExt/XephemAstroLib/circum.c
- Timestamp:
- Oct 22, 2001, 2:08:28 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/circum.c
r1457 r1719 67 67 double lam, bet; /* geocentric ecliptic long and lat */ 68 68 double dia, mag; /* angular diameter at 1 AU and magnitude */ 69 double f; /* fractional phase from earth */70 69 int p; 71 70 … … 84 83 sunpos (mjed, &lsn, &rsn, 0); 85 84 86 /* find helio long/lat; sun/planet and earth/plan t dist; ecliptic85 /* find helio long/lat; sun/planet and earth/planet dist; ecliptic 87 86 * long/lat; diameter and mag. 88 87 */ … … 92 91 cir_sky (np, lpd, psi, rp, &rho, lam, bet, lsn, rsn, op); 93 92 94 /* compute magnitude and angular size */ 95 f = op->s_phase ? 5*log10(rp*rho) - 5*log10(op->s_phase/100) : 100; 96 set_smag (op, mag+f); 93 /* set magnitude and angular size */ 94 set_smag (op, mag); 97 95 op->s_size = (float)(dia/rho); 98 96 … … 129 127 ra = op->f_RA; 130 128 dec = op->f_dec; 131 precess (op->f_epoch, mj d, &ra, &dec);129 precess (op->f_epoch, mjed, &ra, &dec); 132 130 133 131 /* convert equatoreal ra/dec to mean geocentric ecliptic lat/long */ 134 eq_ecl (mj d, ra, dec, &bet, &lam);132 eq_ecl (mjed, ra, dec, &bet, &lam); 135 133 136 134 /* find solar ecliptical long.(mean equinox) and distance from earth */ … … 138 136 139 137 /* allow for relativistic light bending near the sun */ 140 deflect (mj d, lam, bet, lsn, rsn, 1e10, &ra, &dec);138 deflect (mjed, lam, bet, lsn, rsn, 1e10, &ra, &dec); 141 139 142 140 /* TODO: correction for annual parallax would go here */ … … 145 143 * geocentric 146 144 */ 147 nut_eq(mj d, &ra, &dec);148 ab_eq(mj d, lsn, &ra, &dec);145 nut_eq(mjed, &ra, &dec); 146 ab_eq(mjed, lsn, &ra, &dec); 149 147 op->s_gaera = (float)ra; 150 148 op->s_gaedec = (float)dec; … … 193 191 double dt; /* light travel time to object */ 194 192 double lg; /* helio long of earth */ 195 double nu, ea; /* true anomaly and eccentric anomaly */ 196 double ma; /* mean anomaly */ 193 double nu; /* true anomaly */ 197 194 double rp=0; /* distance from the sun */ 198 195 double lo, slo, clo; /* angle from ascending node */ … … 206 203 double lam; /* geocentric ecliptic longitude */ 207 204 double bet; /* geocentric ecliptic latitude */ 208 double e; /* fast eccentricity */209 205 double ll=0, sll, cll; /* helio angle between object and earth */ 210 206 double mag; /* magnitude */ 211 207 double e_n; /* mean daily motion */ 208 double tp; /* time from perihelion (days) */ 212 209 double rpd=0; 213 210 double y; … … 217 214 sunpos (mjed, &lsn, &rsn, 0); 218 215 lg = lsn + PI; 219 220 /* faster access to eccentricty */221 e = op->e_e;222 216 223 217 /* mean daily motion is derived fro mean distance */ … … 235 229 &inc, &om, &Om); 236 230 237 ma = degrad (op->e_M + (mjed - op->e_cepoch - dt) *e_n);238 anomaly (ma, e, &nu, &ea);239 rp = op->e_a * (1-e*e) / (1+e*cos(nu));231 tp = mjed - dt - (op->e_cepoch - op->e_M/e_n); 232 vrc (&nu, &rp, tp, op->e_e, op->e_a*(1-op->e_e)); 233 nu = degrad(nu); 240 234 lo = nu + om; 241 235 slo = sin(lo); … … 301 295 double dt; /* light travel time to object */ 302 296 double lg; /* helio long of earth */ 303 double nu, ea; /* true anomaly and eccentric anomaly */ 304 double ma; /* mean anomaly */ 297 double nu; /* true anomaly and eccentric anomaly */ 305 298 double rp=0; /* distance from the sun */ 306 299 double lo, slo, clo; /* angle from ascending node */ … … 319 312 double mag; /* magnitude */ 320 313 double a; /* mean distance */ 314 double tp; /* time from perihelion (days) */ 321 315 double rpd=0; 322 316 double y; … … 342 336 &inc, &om, &Om); 343 337 344 ma = degrad ((mjed - op->h_ep - dt) * n);345 anomaly (ma, e, &nu, &ea);346 rp = a * (e*e-1.0) / (1.0+e*cos(nu));338 tp = mjed - dt - op->h_ep; 339 vrc (&nu, &rp, tp, op->h_e, op->h_qp); 340 nu = degrad(nu); 347 341 lo = nu + om; 348 342 slo = sin(lo); … … 581 575 582 576 /* convert to equatoreal [mean equator, with mean obliquity] */ 583 ecl_eq (mj d, bet, lam, &ra, &dec);577 ecl_eq (mjed, bet, lam, &ra, &dec); 584 578 tra = ra; /* keep mean coordinates */ 585 579 tdec = dec; … … 592 586 */ 593 587 if (!is_planet(op,SUN) && !is_planet(op,MOON)) 594 deflect (mj d, op->s_hlong, op->s_hlat, lsn, rsn, *rho, &ra, &dec);588 deflect (mjed, op->s_hlong, op->s_hlat, lsn, rsn, *rho, &ra, &dec); 595 589 596 590 /* correct ra/dec to form geocentric apparent */ 597 nut_eq (mj d, &ra, &dec);591 nut_eq (mjed, &ra, &dec); 598 592 if (!is_planet(op,MOON)) 599 ab_eq (mj d, lsn, &ra, &dec);593 ab_eq (mjed, lsn, &ra, &dec); 600 594 op->s_gaera = (float)ra; 601 595 op->s_gaedec = (float)dec; … … 635 629 ra = tra + dra; 636 630 dec = tdec + ddec; 637 precess (mj d, epoch, &ra, &dec);631 precess (mjed, epoch, &ra, &dec); 638 632 } 639 633 range(&ra, 2*PI); … … 755 749 756 750 /* For RCS Only -- Do Not Edit */ 757 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: circum.c,v $ $Date: 2001- 04-10 14:40:46 $ $Revision: 1.1.1.1$ $Name: not supported by cvs2svn $"};751 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: circum.c,v $ $Date: 2001-10-22 12:08:26 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
Note:
See TracChangeset
for help on using the changeset viewer.