예제 #1
0
        public override Vector2 <decimal> EquatorialCoordinates(DateTime date)
        {
            var pos = EclipticEarth3D(date);
            var X = pos.X; var Y = pos.Y; var Z = pos.Z;
            var R         = DecimalMath.Sqrt(X * X + Y * Y + Z * Z);
            var lambda    = DecimalMath.Atan2(Y, X);
            var sinLambda = DecimalMath.Sin(lambda);
            var cosLambda = DecimalMath.Cos(lambda);
            var beta      = DecimalMath.Asin(Z / R);
            var tanBeta   = DecimalMath.Tan(beta);
            var sinBeta   = DecimalMath.Sin(beta);
            var cosBeta   = DecimalMath.Cos(beta);

            var tilt    = CommonCalculations.GetAxialTilt(date) * DecimalMath.DegToRad;
            var cosTilt = DecimalMath.Cos(tilt);
            var sinTilt = DecimalMath.Sin(tilt);
            var RA      = DecimalMath.Atan2(sinLambda * cosTilt - tanBeta * sinTilt, cosLambda) * DecimalMath.RadToDeg;
            var Dec     = DecimalMath.Asin(sinBeta * cosTilt + cosBeta * sinTilt * sinLambda) * DecimalMath.RadToDeg;

            RA = CommonCalculations.From0To360(RA);
#if DEBUG
            Console.WriteLine($"R = {R} lambda = {lambda}, beta = {beta}, tilt = {tilt}, RA = {RA}, dec = {Dec}");
#endif

            return(new Vector2 <decimal>(RA, Dec));
        }
예제 #2
0
        public Vector2 <decimal> EquatorialCoordinates(DateTime date)
        {
            var DegToRad = DecimalMath.DegToRad;

            var d = JulianDateCalculator.ToJulianDaysJ2000(date);
            var L = FL(d); var Lrad = L * DegToRad;
            var M = FMMoon(d); var Mrad = M * DegToRad;
            var F = FF(d); var Frad = F * DegToRad;

            var lambda = (L + 6.289M * DecimalMath.Sin(Mrad)) * DegToRad;
            var beta   = (5.128m * DecimalMath.Sin(Frad)) * DegToRad;
            var tilt   = CommonCalculations.GetAxialTilt(date) * DegToRad;

            var sinLambda = DecimalMath.Sin(lambda);
            var cosLambda = DecimalMath.Cos(lambda);

            var sinBeta = DecimalMath.Sin(beta);
            var cosBeta = DecimalMath.Cos(beta);
            var tanBeta = DecimalMath.Tan(beta);

            var sinTilt = DecimalMath.Sin(tilt);
            var cosTilt = DecimalMath.Cos(tilt);

            var RA  = DecimalMath.Atan2(sinLambda * cosTilt - tanBeta * sinTilt, cosLambda) * DecimalMath.RadToDeg;
            var Dec = DecimalMath.Asin(sinBeta * cosTilt + cosBeta * sinTilt * sinLambda) * DecimalMath.RadToDeg;

            return(new Vector2 <decimal>(CommonCalculations.From0To360(RA), Dec));
        }
예제 #3
0
        public override Vector2 <decimal> EquatorialCoordinates(DateTime date)
        {
            var pos = EclipticEarth3D(date);

#if DEBUG
            Console.WriteLine($"Sun ecliptic position: X={pos.X} Y={pos.Y} Z={pos.Z}");
#endif

            var tiltRad = CommonCalculations.GetAxialTilt(date) * DecimalMath.DegToRad;
            var Xe      = pos.X;
            var Ye      = pos.Y * DecimalMath.Cos(tiltRad);
            var Ze      = pos.Y * DecimalMath.Sin(tiltRad);

#if DEBUG
            Console.WriteLine($"Sun equatorial position: X={Xe} Y={Ye} Z={Ze} with tilt {tiltRad}");
#endif

            var RA  = DecimalMath.Atan2(Ye, Xe) * DecimalMath.RadToDeg;
            var Dec = DecimalMath.Atan2(Ze, DecimalMath.Sqrt(Xe * Xe + Ye * Ye)) * DecimalMath.RadToDeg;

#if DEBUG
            Console.WriteLine($"Sun RA = {RA} Dec={Dec}");
#endif
            return(new Vector2 <decimal>(CommonCalculations.From0To360(RA), Dec));
        }
예제 #4
0
        public override Vector2 <decimal> EclipticCoordinates(DateTime date)
        {
            var pos = EclipticEarth3D(date);
            var lon = DecimalMath.Atan2(pos.Y, pos.X) * DecimalMath.RadToDeg;
            var lat = DecimalMath.Asin(pos.Z / DecimalMath.Sqrt(pos.X * pos.X + pos.Y * pos.Y + pos.Z * pos.Z)) * DecimalMath.RadToDeg;

            return(new Vector2 <decimal>(CommonCalculations.From0To360(lon), lat));
        }
예제 #5
0
        public override Vector2 <decimal> ApparentEclipticEarth(DateTime date)
        {
            var pos = ApparentEclipticEarth3D(date);
            var lon = DecimalMath.Atan2(pos.Y, pos.X) * DecimalMath.RadToDeg;
            var lat = DecimalMath.Asin(pos.Z / DecimalMath.Sqrt(pos.X * pos.X + pos.Y * pos.Y + pos.Z * pos.Z)) * DecimalMath.RadToDeg;

            lon = CommonCalculations.From0To360(lon);
            lat = CommonCalculations.From0To360(lat);
            return(new Vector2 <decimal>(lon, lat));
        }
예제 #6
0
        public Vector2 <decimal> EclipticCoordinates(DateTime date)
        {
            var DegToRad = DecimalMath.DegToRad;

            var T = JulianDateCalculator.ToJulianCenturiesJ2000(date);
            var L = CommonCalculations.From0To360(FL(T));
            var M = CommonCalculations.From0To360(FMMoon(T)); var Mrad = M * DegToRad;
            var F = CommonCalculations.From0To360(FF(T)); var Frad = F * DegToRad;

            var lambda = CommonCalculations.From0To360(L + 1e-6M * CalculateSumLongitude(date));
            var beta   = (5.128m * DecimalMath.Sin(Frad));

#if DEBUG
            Console.WriteLine($"Julian centuries passed: {T}, L = {L}, M = {M}, F = {F}");
            Console.WriteLine($"Lambda: {lambda}, Beta : {beta}");
#endif


            return(new Vector2 <decimal>(lambda, beta));
        }
예제 #7
0
        public Vector2 <decimal> EquatorialCoordinates(DateTime date)
        {
            var tilt    = CommonCalculations.GetAxialTilt(date) * DecimalMath.DegToRad;
            var sintilt = DecimalMath.Sin(tilt);
            var costilt = DecimalMath.Cos(tilt);

            var pos = EclipticEarthXYZ(date);
            var xe  = pos.X;
            var ye  = pos.Y * costilt - pos.Z * sintilt;
            var ze  = pos.Y * sintilt - pos.Z * costilt;

#if DEBUG
            Console.WriteLine($"Pluto equatorial X= {xe}, Y = {ye}, Z = {ze}");
#endif

            var RA  = DecimalMath.Atan2(ye, xe) * DecimalMath.RadToDeg;
            var Dec = DecimalMath.Atan2(ze, DecimalMath.Sqrt(xe * xe, ye * ye)) * DecimalMath.RadToDeg;

#if DEBUG
            Console.WriteLine($"Pluto Ra= {RA}, DEC = {Dec}");
#endif
            return(new Vector2 <decimal>(CommonCalculations.From0To360(RA), Dec));
        }
예제 #8
0
        public Vector2 <decimal> EclipticCoordinates(DateTime date)
        {
            var d = JulianDateCalculator.ToJulianDaysJ2000(date);

            return(new Vector2 <decimal>(CommonCalculations.From0To360(n0 + n1 * d), 0));
        }