コード例 #1
0
ファイル: GCMoonData.cs プロジェクト: icfsoft/GCAL-NET-Core
        //==================================================================================
        //
        //==================================================================================



        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)));
        }
コード例 #2
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);
        }