/// <summary> /// Based on Chapter 39, Meeus and Chapter 10 /// </summary> /// <param name="obs"></param> public void makeTopocentric(GPObserver obs) { double u, h, delta_alpha; double rho_sin, rho_cos; const double b_a = 0.99664719; // geocentric position of observer on the earth surface // 10.1 - 10.3 u = GPMath.arctanDeg(b_a * b_a * GPMath.tanDeg(obs.GetLatitudeNorthPositive())); rho_sin = b_a * GPMath.sinDeg(u) + obs.GetAltitude() / 6378140.0 * GPMath.sinDeg(obs.GetLatitudeNorthPositive()); rho_cos = GPMath.cosDeg(u) + obs.GetAltitude() / 6378140.0 * GPMath.cosDeg(obs.GetLatitudeNorthPositive()); // equatorial horizontal paralax // 39.1 this.parallax = GPMath.arcsinDeg(GPMath.sinDeg(8.794 / 3600) / (this.distanceFromEarth / GPAstroEngine.AU)); // geocentric hour angle of the body h = apparent_sidereal_time - obs.GetLongitudeWestPositive() - right_ascession; // 39.2 delta_alpha = GPMath.arctanDeg( (-rho_cos * GPMath.sinDeg(this.parallax) * GPMath.sinDeg(h)) / (GPMath.cosDeg(this.declination) - rho_cos * GPMath.sinDeg(this.parallax) * GPMath.cosDeg(h))); this.right_ascession += delta_alpha; this.declination = GPMath.arctanDeg( ((GPMath.sinDeg(this.declination) - rho_sin * GPMath.sinDeg(this.parallax)) * GPMath.cosDeg(delta_alpha)) / (GPMath.cosDeg(this.declination) - rho_cos * GPMath.sinDeg(this.parallax) * GPMath.cosDeg(h))); }