Esempio n. 1
0
        public static AAS3DCoordinate EquatorialRectangularCoordinatesB1950(double JD, bool bHighPrecision)
        {
            AAS3DCoordinate value = EclipticRectangularCoordinatesJ2000(JD, bHighPrecision);

            value = AASFK5.ConvertVSOPToFK5B1950(value);

            return(value);
        }
Esempio n. 2
0
        public static AAS3DCoordinate EquatorialRectangularCoordinatesJ2000(double JD)
        {
            AAS3DCoordinate value = EclipticRectangularCoordinatesJ2000(JD);

            value = AASFK5.ConvertVSOPToFK5J2000(value);

            return(value);
        }
Esempio n. 3
0
        public static AAS3DCoordinate EquatorialRectangularCoordinatesAnyEquinox(double JD, double JDEquinox, bool bHighPrecision)
        {
            AAS3DCoordinate value = EquatorialRectangularCoordinatesJ2000(JD, bHighPrecision);

            value = AASFK5.ConvertVSOPToFK5AnyEquinox(value, JDEquinox);

            return(value);
        }
Esempio n. 4
0
        public static AAS3DCoordinate ConvertVSOPToFK5B1950(AAS3DCoordinate value)
        {
            AAS3DCoordinate result = new AAS3DCoordinate()
            {
                X = 0.999925702634 * value.X + 0.012189716217 * value.Y + 0.000011134016 * value.Z,
                Y = -0.011179418036 * value.X + 0.917413998946 * value.Y - 0.397777041885 * value.Z,
                Z = -0.004859003787 * value.X + 0.397747363646 * value.Y + 0.917482111428 * value.Z
            };

            return(result);
        }
Esempio n. 5
0
        public static AAS3DCoordinate ConvertVSOPToFK5J2000(AAS3DCoordinate value)
        {
            AAS3DCoordinate result = new AAS3DCoordinate()
            {
                X = value.X + 0.000000440360 * value.Y - 0.000000190919 * value.Z,
                Y = -0.000000479966 * value.X + 0.917482137087 * value.Y - 0.397776982902 * value.Z,
                Z = 0.397776982902 * value.Y + 0.917482137087 * value.Z
            };

            return(result);
        }
Esempio n. 6
0
        public static AAS3DCoordinate ConvertVSOPToFK5J2000(AAS3DCoordinate value)
        {
            AAS3DCoordinate result = new AAS3DCoordinate()
            {
            X = value.X + 0.000000440360 * value.Y - 0.000000190919 * value.Z,
            Y = -0.000000479966 * value.X + 0.917482137087 * value.Y - 0.397776982902 * value.Z,
            Z = 0.397776982902 * value.Y + 0.917482137087 * value.Z
            };

            return result;
        }
Esempio n. 7
0
        public static AAS3DCoordinate ConvertVSOPToFK5B1950(AAS3DCoordinate value)
        {
            AAS3DCoordinate result = new AAS3DCoordinate()
            {
            X = 0.999925702634 * value.X + 0.012189716217 * value.Y + 0.000011134016 * value.Z,
            Y = -0.011179418036 * value.X + 0.917413998946 * value.Y - 0.397777041885 * value.Z,
            Z = -0.004859003787 * value.X + 0.397747363646 * value.Y + 0.917482111428 * value.Z
            };

            return result;
        }
        public static AAS3DCoordinate EarthVelocity(double JD, bool bHighPrecision)
        {
            AAS3DCoordinate velocity = new AAS3DCoordinate();

            if (bHighPrecision)
            {
                velocity.X  = AASVSOP87A_Earth.X_DASH(JD);
                velocity.Y  = AASVSOP87A_Earth.Y_DASH(JD);
                velocity.Z  = AASVSOP87A_Earth.Z_DASH(JD);
                velocity    = AASFK5.ConvertVSOPToFK5J2000(velocity);
                velocity.X *= 100000000;
                velocity.Y *= 100000000;
                velocity.Z *= 100000000;
                return(velocity);
            }

            double T     = (JD - 2451545) / 36525;
            double L2    = 3.1761467 + 1021.3285546 * T;
            double L3    = 1.7534703 + 628.3075849 * T;
            double L4    = 6.2034809 + 334.0612431 * T;
            double L5    = 0.5995465 + 52.9690965 * T;
            double L6    = 0.8740168 + 21.3299095 * T;
            double L7    = 5.4812939 + 7.4781599 * T;
            double L8    = 5.3118863 + 3.8133036 * T;
            double Ldash = 3.8103444 + 8399.6847337 * T;
            double D     = 5.1984667 + 7771.3771486 * T;
            double Mdash = 2.3555559 + 8328.6914289 * T;
            double F     = 1.6279052 + 8433.4661601 * T;



            int nAberrationCoefficients = g_AberrationCoefficients.Length;

            for (int i = 0; i < nAberrationCoefficients; i++)
            {
                double Argument = g_AberrationCoefficients[i].L2 * L2 + g_AberrationCoefficients[i].L3 * L3 +
                                  g_AberrationCoefficients[i].L4 * L4 + g_AberrationCoefficients[i].L5 * L5 +
                                  g_AberrationCoefficients[i].L6 * L6 + g_AberrationCoefficients[i].L7 * L7 +
                                  g_AberrationCoefficients[i].L8 * L8 + g_AberrationCoefficients[i].Ldash * Ldash +
                                  g_AberrationCoefficients[i].D * D + g_AberrationCoefficients[i].Mdash * Mdash +
                                  g_AberrationCoefficients[i].F * F;
                velocity.X += (g_AberrationCoefficients[i].xsin + g_AberrationCoefficients[i].xsint * T) * Math.Sin(Argument);
                velocity.X += (g_AberrationCoefficients[i].xcos + g_AberrationCoefficients[i].xcost * T) * Math.Cos(Argument);

                velocity.Y += (g_AberrationCoefficients[i].ysin + g_AberrationCoefficients[i].ysint * T) * Math.Sin(Argument);
                velocity.Y += (g_AberrationCoefficients[i].ycos + g_AberrationCoefficients[i].ycost * T) * Math.Cos(Argument);

                velocity.Z += (g_AberrationCoefficients[i].zsin + g_AberrationCoefficients[i].zsint * T) * Math.Sin(Argument);
                velocity.Z += (g_AberrationCoefficients[i].zcos + g_AberrationCoefficients[i].zcost * T) * Math.Cos(Argument);
            }

            return(velocity);
        }
Esempio n. 9
0
        public static AAS3DCoordinate EquatorialRectangularCoordinatesMeanEquinox(double JD, bool bHighPrecision)
        {
            double Longitude = AASCoordinateTransformation.DegreesToRadians(GeometricFK5EclipticLongitude(JD, bHighPrecision));
            double Latitude  = AASCoordinateTransformation.DegreesToRadians(GeometricFK5EclipticLatitude(JD, bHighPrecision));
            double R         = AASEarth.RadiusVector(JD, bHighPrecision);
            double epsilon   = AASCoordinateTransformation.DegreesToRadians(AASNutation.MeanObliquityOfEcliptic(JD));

            AAS3DCoordinate value = new AAS3DCoordinate
            {
                X = R * Math.Cos(Latitude) * Math.Cos(Longitude),
                Y = R * (Math.Cos(Latitude) * Math.Sin(Longitude) * Math.Cos(epsilon) - Math.Sin(Latitude) * Math.Sin(epsilon)),
                Z = R * (Math.Cos(Latitude) * Math.Sin(Longitude) * Math.Sin(epsilon) + Math.Sin(Latitude) * Math.Cos(epsilon))
            };

            return(value);
        }
Esempio n. 10
0
        public static AAS3DCoordinate EquatorialRectangularCoordinatesMeanEquinox(double JD)
        {
            double Longitude = AASCoordinateTransformation.DegreesToRadians(GeometricFK5EclipticLongitude(JD));
            double Latitude = AASCoordinateTransformation.DegreesToRadians(GeometricFK5EclipticLatitude(JD));
            double R = AASEarth.RadiusVector(JD);
            double epsilon = AASCoordinateTransformation.DegreesToRadians(AASNutation.MeanObliquityOfEcliptic(JD));

            AAS3DCoordinate value = new AAS3DCoordinate()
            {
            X = R * Math.Cos(Latitude) * Math.Cos(Longitude),
            Y = R * (Math.Cos(Latitude) * Math.Sin(Longitude) * Math.Cos(epsilon) - Math.Sin(Latitude) * Math.Sin(epsilon)),
            Z = R * (Math.Cos(Latitude) * Math.Sin(Longitude) * Math.Sin(epsilon) + Math.Sin(Latitude) * Math.Cos(epsilon))
            };

            return value;
        }
Esempio n. 11
0
        public static AAS3DCoordinate EclipticRectangularCoordinatesJ2000(double JD)
        {
            double Longitude = GeometricEclipticLongitudeJ2000(JD);
            Longitude = AASCoordinateTransformation.DegreesToRadians(Longitude);
            double Latitude = GeometricEclipticLatitudeJ2000(JD);
            Latitude = AASCoordinateTransformation.DegreesToRadians(Latitude);
            double R = AASEarth.RadiusVector(JD);

            double coslatitude = Math.Cos(Latitude);
            AAS3DCoordinate value = new AAS3DCoordinate()
            {
            X = R * coslatitude * Math.Cos(Longitude),
            Y = R * coslatitude * Math.Sin(Longitude),
            Z = R * Math.Sin(Latitude)
            };

            return value;
        }
Esempio n. 12
0
        public static AAS3DCoordinate ConvertVSOPToFK5AnyEquinox(AAS3DCoordinate value, double JDEquinox)
        {
            double t        = (JDEquinox - 2451545.0) / 36525;
            double tsquared = t * t;
            double tcubed   = tsquared * t;

            double sigma = 2306.2181 * t + 0.30188 * tsquared + 0.017988 * tcubed;

            sigma = AASCoordinateTransformation.DegreesToRadians(AASCoordinateTransformation.DMSToDegrees(0, 0, sigma));

            double zeta = 2306.2181 * t + 1.09468 * tsquared + 0.018203 * tcubed;

            zeta = AASCoordinateTransformation.DegreesToRadians(AASCoordinateTransformation.DMSToDegrees(0, 0, zeta));

            double phi = 2004.3109 * t - 0.42665 * tsquared - 0.041833 * tcubed;

            phi = AASCoordinateTransformation.DegreesToRadians(AASCoordinateTransformation.DMSToDegrees(0, 0, phi));

            double cossigma = Math.Cos(sigma);
            double coszeta  = Math.Cos(zeta);
            double cosphi   = Math.Cos(phi);
            double sinsigma = Math.Sin(sigma);
            double sinzeta  = Math.Sin(zeta);
            double sinphi   = Math.Sin(phi);

            double xx = cossigma * coszeta * cosphi - sinsigma * sinzeta;
            double xy = sinsigma * coszeta + cossigma * sinzeta * cosphi;
            double xz = cossigma * sinphi;
            double yx = -cossigma * sinzeta - sinsigma * coszeta * cosphi;
            double yy = cossigma * coszeta - sinsigma * sinzeta * cosphi;
            double yz = -sinsigma * sinphi;
            double zx = -coszeta * sinphi;
            double zy = -sinzeta * sinphi;
            double zz = cosphi;

            AAS3DCoordinate result = new AAS3DCoordinate()
            {
                X = xx * value.X + yx * value.Y + zx * value.Z,
                Y = xy * value.X + yy * value.Y + zy * value.Z,
                Z = xz * value.X + yz * value.Y + zz * value.Z
            };

            return(result);
        }
        public static AAS2DCoordinate EquatorialAberration(double Alpha, double Delta, double JD, bool bHighPrecision)
        {
            //Convert to radians
            Alpha = AASCoordinateTransformation.DegreesToRadians(Alpha * 15);
            Delta = AASCoordinateTransformation.DegreesToRadians(Delta);

            double cosAlpha = Math.Cos(Alpha);
            double sinAlpha = Math.Sin(Alpha);
            double cosDelta = Math.Cos(Delta);
            double sinDelta = Math.Sin(Delta);

            AAS3DCoordinate velocity = EarthVelocity(JD, bHighPrecision);

            //What is the return value
            AAS2DCoordinate aberration = new AAS2DCoordinate {
                X = AASCoordinateTransformation.RadiansToHours((velocity.Y * cosAlpha - velocity.X * sinAlpha) / (17314463350.0 * cosDelta)), Y = AASCoordinateTransformation.RadiansToDegrees(-(((velocity.X * cosAlpha + velocity.Y * sinAlpha) * sinDelta - velocity.Z * cosDelta) / 17314463350.0))
            };

            return(aberration);
        }
Esempio n. 14
0
        public static AAS3DCoordinate EclipticRectangularCoordinatesJ2000(double JD, bool bHighPrecision)
        {
            double Longitude = GeometricEclipticLongitudeJ2000(JD, bHighPrecision);

            Longitude = AASCoordinateTransformation.DegreesToRadians(Longitude);
            double Latitude = GeometricEclipticLatitudeJ2000(JD, bHighPrecision);

            Latitude = AASCoordinateTransformation.DegreesToRadians(Latitude);
            double R = AASEarth.RadiusVector(JD, bHighPrecision);

            double          coslatitude = Math.Cos(Latitude);
            AAS3DCoordinate value       = new AAS3DCoordinate
            {
                X = R * coslatitude * Math.Cos(Longitude),
                Y = R * coslatitude * Math.Sin(Longitude),
                Z = R * Math.Sin(Latitude)
            };

            return(value);
        }
Esempio n. 15
0
        public static AAS3DCoordinate ConvertVSOPToFK5AnyEquinox(AAS3DCoordinate value, double JDEquinox)
        {
            double t = (JDEquinox - 2451545.0) / 36525;
            double tsquared = t * t;
            double tcubed = tsquared * t;

            double sigma = 2306.2181 * t + 0.30188 * tsquared + 0.017988 * tcubed;
            sigma = AASCoordinateTransformation.DegreesToRadians(AASCoordinateTransformation.DMSToDegrees(0, 0, sigma));

            double zeta = 2306.2181 * t + 1.09468 * tsquared + 0.018203 * tcubed;
            zeta = AASCoordinateTransformation.DegreesToRadians(AASCoordinateTransformation.DMSToDegrees(0, 0, zeta));

            double phi = 2004.3109 * t - 0.42665 * tsquared - 0.041833 * tcubed;
            phi = AASCoordinateTransformation.DegreesToRadians(AASCoordinateTransformation.DMSToDegrees(0, 0, phi));

            double cossigma = Math.Cos(sigma);
            double coszeta = Math.Cos(zeta);
            double cosphi = Math.Cos(phi);
            double sinsigma = Math.Sin(sigma);
            double sinzeta = Math.Sin(zeta);
            double sinphi = Math.Sin(phi);

            double xx = cossigma * coszeta * cosphi - sinsigma * sinzeta;
            double xy = sinsigma * coszeta + cossigma * sinzeta * cosphi;
            double xz = cossigma * sinphi;
            double yx = -cossigma * sinzeta - sinsigma * coszeta * cosphi;
            double yy = cossigma * coszeta - sinsigma * sinzeta * cosphi;
            double yz = -sinsigma * sinphi;
            double zx = -coszeta * sinphi;
            double zy = -sinzeta * sinphi;
            double zz = cosphi;

            AAS3DCoordinate result = new AAS3DCoordinate()
            {
            X = xx * value.X + yx * value.Y + zx * value.Z,
            Y = xy * value.X + yy * value.Y + zy * value.Z,
            Z = xz * value.X + yz * value.Y + zz * value.Z
            };

            return result;
        }
Esempio n. 16
0
        public static AAS3DCoordinate EarthVelocity(double JD)
        {
            double T = (JD - 2451545) / 36525;
            double L2 = 3.1761467 + 1021.3285546 * T;
            double L3 = 1.7534703 + 628.3075849 * T;
            double L4 = 6.2034809 + 334.0612431 * T;
            double L5 = 0.5995465 + 52.9690965 * T;
            double L6 = 0.8740168 + 21.3299095 * T;
            double L7 = 5.4812939 + 7.4781599 * T;
            double L8 = 5.3118863 + 3.8133036 * T;
            double Ldash = 3.8103444 + 8399.6847337 * T;
            double D = 5.1984667 + 7771.3771486 * T;
            double Mdash = 2.3555559 + 8328.6914289 * T;
            double F = 1.6279052 + 8433.4661601 * T;

            AAS3DCoordinate velocity = new AAS3DCoordinate();

            int nAberrationCoefficients = g_AberrationCoefficients.Length;
            for (int i = 0; i < nAberrationCoefficients; i++)
            {
                double Argument = g_AberrationCoefficients[i].L2 * L2 + g_AberrationCoefficients[i].L3 * L3 +
                g_AberrationCoefficients[i].L4 * L4 + g_AberrationCoefficients[i].L5 * L5 +
                g_AberrationCoefficients[i].L6 * L6 + g_AberrationCoefficients[i].L7 * L7 +
                g_AberrationCoefficients[i].L8 * L8 + g_AberrationCoefficients[i].Ldash * Ldash +
                g_AberrationCoefficients[i].D * D + g_AberrationCoefficients[i].Mdash * Mdash +
                g_AberrationCoefficients[i].F * F;
                velocity.X += (g_AberrationCoefficients[i].xsin + g_AberrationCoefficients[i].xsint * T) * Math.Sin(Argument);
                velocity.X += (g_AberrationCoefficients[i].xcos + g_AberrationCoefficients[i].xcost * T) * Math.Cos(Argument);

                velocity.Y += (g_AberrationCoefficients[i].ysin + g_AberrationCoefficients[i].ysint * T) * Math.Sin(Argument);
                velocity.Y += (g_AberrationCoefficients[i].ycos + g_AberrationCoefficients[i].ycost * T) * Math.Cos(Argument);

                velocity.Z += (g_AberrationCoefficients[i].zsin + g_AberrationCoefficients[i].zsint * T) * Math.Sin(Argument);
                velocity.Z += (g_AberrationCoefficients[i].zcos + g_AberrationCoefficients[i].zcost * T) * Math.Cos(Argument);
            }

            return velocity;
        }
Esempio n. 17
0
 public AASNearParabolicObjectDetails()
 {
     HeliocentricRectangularEquatorial = new AAS3DCoordinate();
     HeliocentricRectangularEcliptical = new AAS3DCoordinate();
 }
Esempio n. 18
0
        public static AASNearParabolicObjectDetails Calculate(double JD, ref AASNearParabolicObjectElements elements, bool bHighPrecision)
        {
            double Epsilon = AASNutation.MeanObliquityOfEcliptic(elements.JDEquinox);

            double JD0 = JD;

            //What will be the return value
            AASNearParabolicObjectDetails details = new AASNearParabolicObjectDetails();

            Epsilon = AASCoordinateTransformation.DegreesToRadians(Epsilon);
            double omega = AASCoordinateTransformation.DegreesToRadians(elements.omega);
            double w     = AASCoordinateTransformation.DegreesToRadians(elements.w);
            double i     = AASCoordinateTransformation.DegreesToRadians(elements.i);

            double sinEpsilon = Math.Sin(Epsilon);
            double cosEpsilon = Math.Cos(Epsilon);
            double sinOmega   = Math.Sin(omega);
            double cosOmega   = Math.Cos(omega);
            double cosi       = Math.Cos(i);
            double sini       = Math.Sin(i);

            double F = cosOmega;
            double G = sinOmega * cosEpsilon;
            double H = sinOmega * sinEpsilon;
            double P = -sinOmega * cosi;
            double Q = cosOmega * cosi * cosEpsilon - sini * sinEpsilon;
            double R = cosOmega * cosi * sinEpsilon + sini * cosEpsilon;
            double a = Math.Sqrt(F * F + P * P);
            double b = Math.Sqrt(G * G + Q * Q);
            double c = Math.Sqrt(H * H + R * R);
            double A = Math.Atan2(F, P);
            double B = Math.Atan2(G, Q);
            double C = Math.Atan2(H, R);

            AAS3DCoordinate SunCoord = AASSun.EquatorialRectangularCoordinatesAnyEquinox(JD, elements.JDEquinox, bHighPrecision);

            for (int j = 0; j < 2; j++)
            {
                double v = 0;
                double r = 0;
                CalulateTrueAnnomalyAndRadius(JD0, ref elements, ref v, ref r);

                double x = r * a * Math.Sin(A + w + v);
                double y = r * b * Math.Sin(B + w + v);
                double z = r * c * Math.Sin(C + w + v);

                if (j == 0)
                {
                    details.HeliocentricRectangularEquatorial.X = x;
                    details.HeliocentricRectangularEquatorial.Y = y;
                    details.HeliocentricRectangularEquatorial.Z = z;

                    //Calculate the heliocentric ecliptic coordinates also
                    double u    = w + v;
                    double cosu = Math.Cos(u);
                    double sinu = Math.Sin(u);

                    details.HeliocentricRectangularEcliptical.X = r * (cosOmega * cosu - sinOmega * sinu * cosi);
                    details.HeliocentricRectangularEcliptical.Y = r * (sinOmega * cosu + cosOmega * sinu * cosi);
                    details.HeliocentricRectangularEcliptical.Z = r * sini * sinu;

                    details.HeliocentricEclipticLongitude = AASCoordinateTransformation.MapTo0To360Range(AASCoordinateTransformation.RadiansToDegrees(Math.Atan2(details.HeliocentricRectangularEcliptical.Y, details.HeliocentricRectangularEcliptical.X)));
                    details.HeliocentricEclipticLatitude  = AASCoordinateTransformation.RadiansToDegrees(Math.Asin(details.HeliocentricRectangularEcliptical.Z / r));
                }

                double psi   = SunCoord.X + x;
                double nu    = SunCoord.Y + y;
                double sigma = SunCoord.Z + z;

                double Alpha = Math.Atan2(nu, psi);
                Alpha = AASCoordinateTransformation.RadiansToDegrees(Alpha);
                double Delta = Math.Atan2(sigma, Math.Sqrt(psi * psi + nu * nu));
                Delta = AASCoordinateTransformation.RadiansToDegrees(Delta);
                double Distance = Math.Sqrt(psi * psi + nu * nu + sigma * sigma);

                if (j == 0)
                {
                    details.TrueGeocentricRA          = AASCoordinateTransformation.MapTo0To24Range(Alpha / 15);
                    details.TrueGeocentricDeclination = Delta;
                    details.TrueGeocentricDistance    = Distance;
                    details.TrueGeocentricLightTime   = AASElliptical.DistanceToLightTime(Distance);
                }
                else
                {
                    details.AstrometricGeocentricRA          = AASCoordinateTransformation.MapTo0To24Range(Alpha / 15);
                    details.AstrometricGeocentricDeclination = Delta;
                    details.AstrometricGeocentricDistance    = Distance;
                    details.AstrometricGeocentricLightTime   = AASElliptical.DistanceToLightTime(Distance);

                    double RES = Math.Sqrt(SunCoord.X * SunCoord.X + SunCoord.Y * SunCoord.Y + SunCoord.Z * SunCoord.Z);

                    details.Elongation = AASCoordinateTransformation.RadiansToDegrees(Math.Acos((RES * RES + Distance * Distance - r * r) / (2 * RES * Distance)));
                    details.PhaseAngle = AASCoordinateTransformation.RadiansToDegrees(Math.Acos((r * r + Distance * Distance - RES * RES) / (2 * r * Distance)));
                }

                if (j == 0) //Prepare for the next loop around
                {
                    JD0 = JD - details.TrueGeocentricLightTime;
                }
            }

            return(details);
        }
Esempio n. 19
0
 public AASSaturnMoonDetail()
 {
     TrueRectangularCoordinates = new AAS3DCoordinate();
     ApparentRectangularCoordinates = new AAS3DCoordinate();
 }
Esempio n. 20
0
 public AASGalileanMoonDetail()
 {
     TrueRectangularCoordinates     = new AAS3DCoordinate();
     ApparentRectangularCoordinates = new AAS3DCoordinate();
 }