|
|
1.1 ! root 1: #include "sky.h" ! 2: ! 3: helio() ! 4: { ! 5: /* ! 6: * uses lambda, beta, rad, motion ! 7: * uses xms, yms, zms, xdot, ydot, zdot ! 8: * uses mag, semi, psi, tobliq ! 9: * sets alpha, delta ! 10: * sets geolam, geobet, georad ! 11: */ ! 12: ! 13: /* ! 14: * helio converts from ecliptic heliocentric coordinates ! 15: * referred to the mean equinox of date ! 16: * to equatorial geocentric coordinates referred to ! 17: * the true equator and equinox ! 18: */ ! 19: ! 20: double xmp, ymp, zmp; ! 21: double radtemp; ! 22: ! 23: /* ! 24: * compute geocentric distance of object and ! 25: * compute light-time correction (i.i. planetary aberration) ! 26: */ ! 27: ! 28: xmp = rad*cos(beta)*cos(lambda); ! 29: ymp = rad*cos(beta)*sin(lambda); ! 30: zmp = rad*sin(beta); ! 31: georad = sqrt((xmp+xms)*(xmp+xms) + ! 32: (ymp+yms)*(ymp+yms) + ! 33: (zmp+zms)*(zmp+zms)); ! 34: geolam = lambda - .0057756e0*georad*ldot; ! 35: geobet = beta - .0057756*georad*bdot; ! 36: radtemp = georad; ! 37: georad = rad - .0057756*georad*rdot; ! 38: ! 39: xmp = georad*cos(geobet)*cos(geolam); ! 40: ymp = georad*cos(geobet)*sin(geolam); ! 41: zmp = georad*sin(geobet); ! 42: ! 43: /* ! 44: * compute annual parallax from the position of the sun ! 45: */ ! 46: ! 47: xmp += xms; ! 48: ymp += yms; ! 49: zmp += zms; ! 50: georad = sqrt(xmp*xmp + ymp*ymp + zmp*zmp); ! 51: ! 52: /* ! 53: * compute annual (i.e. stellar) aberration ! 54: * from the orbital velocity of the earth ! 55: * (by an incorrect method) ! 56: */ ! 57: ! 58: xmp -= xdot*georad; ! 59: ymp -= ydot*georad; ! 60: zmp -= zdot*georad; ! 61: ! 62: /* ! 63: * perform the nutation and so convert from the mean ! 64: * equator and equinox to the true ! 65: */ ! 66: ! 67: geolam = atan2(ymp, xmp); ! 68: geobet = atan2(zmp, sqrt(xmp*xmp+ymp*ymp)); ! 69: geolam += psi; ! 70: ! 71: /* ! 72: * change to equatorial coordinates ! 73: */ ! 74: ! 75: xmp = georad*cos(geolam)*cos(geobet); ! 76: ymp = georad*(sin(geolam)*cos(geobet)*cos(tobliq) - sin(tobliq)*sin(geobet)); ! 77: zmp = georad*(sin(geolam)*cos(geobet)*sin(tobliq) + cos(tobliq)*sin(geobet)); ! 78: ! 79: alpha = atan2(ymp, xmp); ! 80: delta = atan2(zmp, sqrt(xmp*xmp+ymp*ymp)); ! 81: ! 82: hp = 8.794e0*radsec/georad; ! 83: semi /= georad; ! 84: georad = radtemp; ! 85: if(rad > 0. && rad < 2.e5) ! 86: mag += 2.17*log(rad*georad); ! 87: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.