Example #1
0
        public GCEquatorialCoords getTopocentricEquatorial(GCEarthData obs, double jdate)
        {
            double             u, h, delta_alpha;
            double             rho_sin, rho_cos;
            const double       b_a = 0.99664719;
            GCEquatorialCoords tec = new GCEquatorialCoords();

            double altitude = 0;

            // geocentric position of observer on the earth surface
            // 10.1 - 10.3
            u       = GCMath.arcTanDeg(b_a * b_a * GCMath.tanDeg(obs.latitudeDeg));
            rho_sin = b_a * GCMath.sinDeg(u) + altitude / 6378140.0 * GCMath.sinDeg(obs.latitudeDeg);
            rho_cos = GCMath.cosDeg(u) + altitude / 6378140.0 * GCMath.cosDeg(obs.latitudeDeg);

            // equatorial horizontal paralax
            // 39.1
            double parallax = GCMath.arcSinDeg(GCMath.sinDeg(8.794 / 3600) / (radius / GCMath.AU));

            // geocentric hour angle of the body
            h = GCEarthData.SiderealTimeGreenwich(jdate) + obs.longitudeDeg - rightAscension;


            // 39.2
            delta_alpha = GCMath.arcTanDeg(
                (-rho_cos * GCMath.sinDeg(parallax) * GCMath.sinDeg(h)) /
                (GCMath.cosDeg(this.declination) - rho_cos * GCMath.sinDeg(parallax) * GCMath.cosDeg(h)));
            tec.rightAscension = rightAscension + delta_alpha;
            tec.declination    = declination + GCMath.arcTanDeg(
                ((GCMath.sinDeg(declination) - rho_sin * GCMath.sinDeg(parallax)) * GCMath.cosDeg(delta_alpha)) /
                (GCMath.cosDeg(declination) - rho_cos * GCMath.sinDeg(parallax) * GCMath.cosDeg(h)));

            return(tec);
        }
Example #2
0
        //==================================================================================
        //
        //==================================================================================



        public void calc_horizontal(double date, double longitude, double latitude)
        {
            double h;

            h = GCMath.putIn360(GCEarthData.SiderealTimeGreenwich(date) - this.rightAscension + longitude);

            this.azimuth = GCMath.rad2deg(Math.Atan2(GCMath.sinDeg(h),
                                                     GCMath.cosDeg(h) * GCMath.sinDeg(latitude) -
                                                     GCMath.tanDeg(this.declination) * GCMath.cosDeg(latitude)));

            this.elevation = GCMath.rad2deg(Math.Asin(GCMath.sinDeg(latitude) * GCMath.sinDeg(this.declination) +
                                                      GCMath.cosDeg(latitude) * GCMath.cosDeg(this.declination) * GCMath.cosDeg(h)));
        }
Example #3
0
        public static GCHorizontalCoords equatorialToHorizontalCoords(GCEquatorialCoords eqc, GCEarthData obs, double date)
        {
            double             localHourAngle;
            GCHorizontalCoords hc;

            localHourAngle = GCMath.putIn360(GCEarthData.SiderealTimeGreenwich(date) - eqc.rightAscension + obs.longitudeDeg);

            hc.azimut = GCMath.rad2deg(Math.Atan2(GCMath.sinDeg(localHourAngle),
                                                  GCMath.cosDeg(localHourAngle) * GCMath.sinDeg(obs.latitudeDeg) -
                                                  GCMath.tanDeg(eqc.declination) * GCMath.cosDeg(obs.latitudeDeg)));

            hc.elevation = GCMath.rad2deg(Math.Asin(GCMath.sinDeg(obs.latitudeDeg) * GCMath.sinDeg(eqc.declination) +
                                                    GCMath.cosDeg(obs.latitudeDeg) * GCMath.cosDeg(eqc.declination) * GCMath.cosDeg(localHourAngle)));

            return(hc);
        }
Example #4
0
        public void CorrectEqatorialWithParallax(double jdate, double latitude, double longitude, double height)
        {
            double       u, hourAngleBody, delta_alpha;
            double       rho_sin, rho_cos;
            const double b_a = 0.99664719;

            // calculate geocentric longitude and latitude of observer
            u       = GCMath.arcTanDeg(b_a * b_a * GCMath.tanDeg(latitude));
            rho_sin = b_a * GCMath.sinDeg(u) + height / 6378140.0 * GCMath.sinDeg(latitude);
            rho_cos = GCMath.cosDeg(u) + height / 6378140.0 * GCMath.cosDeg(latitude);

            // calculate paralax
            this.parallax = GCMath.arcSinDeg(GCMath.sinDeg(8.794 / 3600) / (MoonDistance(jdate) / GCMath.AU));

            // calculate correction of equatorial coordinates
            hourAngleBody = GCEarthData.SiderealTimeGreenwich(jdate) + longitude - this.rightAscension;
            delta_alpha   = GCMath.arcTan2Deg(-rho_cos * GCMath.sinDeg(this.parallax) * GCMath.sinDeg(hourAngleBody),
                                              GCMath.cosDeg(this.declination) - rho_cos * GCMath.sinDeg(this.parallax) * GCMath.cosDeg(hourAngleBody));
            this.rightAscension += delta_alpha;
            this.declination    += GCMath.arcTan2Deg(
                (GCMath.sinDeg(this.declination) - rho_sin * GCMath.sinDeg(this.parallax)) * GCMath.cosDeg(delta_alpha),
                GCMath.cosDeg(this.declination) - rho_cos * GCMath.sinDeg(this.parallax) * GCMath.cosDeg(hourAngleBody));
        }