Esempio n. 1
0
        public static AASTopocentricEclipticDetails Ecliptic2Topocentric(double Lambda, double Beta, double Semidiameter, double Distance, double Epsilon, double Latitude, double Height, double JD)
        {
            double S = AASGlobe.RhoSinThetaPrime(Latitude, Height);
            double C = AASGlobe.RhoCosThetaPrime(Latitude, Height);

            //Convert to radians
            Lambda       = AASCoordinateTransformation.DegreesToRadians(Lambda);
            Beta         = AASCoordinateTransformation.DegreesToRadians(Beta);
            Epsilon      = AASCoordinateTransformation.DegreesToRadians(Epsilon);
            Semidiameter = AASCoordinateTransformation.DegreesToRadians(Semidiameter);
            double sine    = Math.Sin(Epsilon);
            double cose    = Math.Cos(Epsilon);
            double cosBeta = Math.Cos(Beta);
            double sinBeta = Math.Sin(Beta);

            //Calculate the Sidereal time
            double theta = AASSidereal.ApparentGreenwichSiderealTime(JD);

            theta = AASCoordinateTransformation.HoursToRadians(theta);
            double sintheta = Math.Sin(theta);

            //Calculate the Parallax
            double pi    = Math.Asin(g_AAParallax_C1 / Distance);
            double sinpi = Math.Sin(pi);

            double N = Math.Cos(Lambda) * cosBeta - C * sinpi * Math.Cos(theta);

            AASTopocentricEclipticDetails Topocentric = new AASTopocentricEclipticDetails {
                Lambda = Math.Atan2(Math.Sin(Lambda) * cosBeta - sinpi * (S * sine + C * cose * sintheta), N)
            };
            double cosTopocentricLambda = Math.Cos(Topocentric.Lambda);

            Topocentric.Beta         = Math.Atan(cosTopocentricLambda * (sinBeta - sinpi * (S * cose - C * sine * sintheta)) / N);
            Topocentric.Semidiameter = Math.Asin(cosTopocentricLambda * Math.Cos(Topocentric.Beta) * Math.Sin(Semidiameter) / N);

            //Convert back to degrees
            Topocentric.Semidiameter = AASCoordinateTransformation.RadiansToDegrees(Topocentric.Semidiameter);
            Topocentric.Lambda       = AASCoordinateTransformation.MapTo0To360Range(AASCoordinateTransformation.RadiansToDegrees(Topocentric.Lambda));
            Topocentric.Beta         = AASCoordinateTransformation.RadiansToDegrees(Topocentric.Beta);

            return(Topocentric);
        }
Esempio n. 2
0
        public static AASTopocentricEclipticDetails Ecliptic2Topocentric(double Lambda, double Beta, double Semidiameter, double Distance, double Epsilon, double Latitude, double Height, double JD)
        {
            double S = AASGlobe.RhoSinThetaPrime(Latitude, Height);
            double C = AASGlobe.RhoCosThetaPrime(Latitude, Height);

            //Convert to radians
            Lambda = AASCoordinateTransformation.DegreesToRadians(Lambda);
            Beta = AASCoordinateTransformation.DegreesToRadians(Beta);
            Epsilon = AASCoordinateTransformation.DegreesToRadians(Epsilon);
            Semidiameter = AASCoordinateTransformation.DegreesToRadians(Semidiameter);
            double sine = Math.Sin(Epsilon);
            double cose = Math.Cos(Epsilon);
            double cosBeta = Math.Cos(Beta);
            double sinBeta = Math.Sin(Beta);

            //Calculate the Sidereal time
            double theta = AASSidereal.ApparentGreenwichSiderealTime(JD);
            theta = AASCoordinateTransformation.HoursToRadians(theta);
            double sintheta = Math.Sin(theta);

            //Calculate the Parallax
            double pi = Math.Asin(g_AAParallax_C1 / Distance);
            double sinpi = Math.Sin(pi);

            double N = Math.Cos(Lambda) * cosBeta - C * sinpi * Math.Cos(theta);

            AASTopocentricEclipticDetails Topocentric = new AASTopocentricEclipticDetails { Lambda = Math.Atan2(Math.Sin(Lambda) * cosBeta - sinpi * (S * sine + C * cose * sintheta), N) };
            double cosTopocentricLambda = Math.Cos(Topocentric.Lambda);
            Topocentric.Beta = Math.Atan(cosTopocentricLambda * (sinBeta - sinpi * (S * cose - C * sine * sintheta)) / N);
            Topocentric.Semidiameter = Math.Asin(cosTopocentricLambda * Math.Cos(Topocentric.Beta) * Math.Sin(Semidiameter) / N);

            //Convert back to degrees
            Topocentric.Semidiameter = AASCoordinateTransformation.RadiansToDegrees(Topocentric.Semidiameter);
            Topocentric.Lambda = AASCoordinateTransformation.MapTo0To360Range(AASCoordinateTransformation.RadiansToDegrees(Topocentric.Lambda));
            Topocentric.Beta = AASCoordinateTransformation.RadiansToDegrees(Topocentric.Beta);

            return Topocentric;
        }