public EquatorialCoords HelToEquatorial(EclipticalCoords Earth, NutObl nutobl)
        {
            EclipticalCoords geo = Utils.HelToGeo(Earth, this);

            geo.r += nutobl.deltapsi;

            return(geo.EclipticalToEquatorial(nutobl));
        }
        public EquatorialCoords EclipticalToEquatorial(NutObl nutobl)
        {
            EquatorialCoords coords = new EquatorialCoords();

            coords.ra  = Math.Atan2((Math.Sin(this.l) * Math.Cos(nutobl.epsilon)) - (Math.Tan(this.b) * Math.Sin(nutobl.epsilon)), Math.Cos(this.l));
            coords.dec = Math.Asin((Math.Sin(this.b) * Math.Cos(nutobl.epsilon)) + (Math.Cos(this.b) * Math.Sin(nutobl.epsilon) * Math.Sin(this.l)));

            return(coords);
        }
Ejemplo n.º 3
0
        //Calculate the corrections in RA/Dec due to nutation
        public static EquatorialCoords Nutation(EquatorialCoords celest, NutObl nutobl)
        {
            EquatorialCoords delta = new EquatorialCoords();

            delta.ra  = nutobl.deltapsi * (Math.Cos(nutobl.epsilon) + Math.Sin(nutobl.epsilon) * Math.Sin(celest.ra) * Math.Tan(celest.dec)) - nutobl.deltaepsilon * Math.Cos(celest.ra) * Math.Tan(celest.dec);
            delta.dec = nutobl.deltapsi * Math.Sin(nutobl.epsilon) * Math.Cos(celest.ra) + nutobl.deltaepsilon * Math.Sin(celest.ra);

            return(delta);
        }
        public EclipticalCoords ToEcliptical(NutObl nutobl)
        {
            EclipticalCoords coords = new EclipticalCoords();

            coords.l = Math.Atan2((Math.Sin(this.ra) * Math.Cos(nutobl.epsilon)) + (Math.Tan(this.dec) * Math.Sin(nutobl.epsilon)), Math.Cos(this.ra));
            coords.b = Math.Asin((Math.Sin(this.dec) * Math.Cos(nutobl.epsilon)) - (Math.Cos(this.dec) * Math.Sin(nutobl.epsilon) * Math.Sin(this.ra)));

            return(coords);
        }
        //Calculate the corrections in RA/Dec due to nutation
        public EquatorialCoords Nutation(NutObl nutobl)
        {
            EquatorialCoords delta = new EquatorialCoords();

            delta.ra  = nutobl.deltapsi * (Math.Cos(nutobl.epsilon) + Math.Sin(nutobl.epsilon) * Math.Sin(this.ra) * Math.Tan(this.dec)) - nutobl.deltaepsilon * Math.Cos(this.ra) * Math.Tan(this.dec);
            delta.dec = nutobl.deltapsi * Math.Sin(nutobl.epsilon) * Math.Cos(this.ra) + nutobl.deltaepsilon * Math.Sin(this.ra);

            ra  = ra + delta.ra;
            dec = dec + delta.dec;

            return(delta);
        }
Ejemplo n.º 6
0
        //Calculate the components  of nutation in longitude and obliquity
        public static NutObl calcNutObl(Double T)
        {
            NutObl nutobl = new NutObl();

            double L     = deg2rad(280.4665 + (36000.7698 * T));
            double Ld    = deg2rad(218.3165 + (481267.8813 * T));
            double omega = deg2rad(125.0445479 - (1934.1362891 * T) + (0.0020754 * T * T) + ((T * T * T) / 467441) - ((T * T * T * T) / 60616000));

            nutobl.epsilon0 = deg2rad(23.4392911111 - (0.013004166667 * T) - ((1.63889 / 10000000) * T * T) + (T * T * T * (5.03611 / 10000000)));

            nutobl.deltaepsilon = deg2rad(((9.2 / 3600) * (Math.Cos(omega))) + ((0.57 / 3600) * (Math.Cos(2 * L))) + ((0.1 / 3600) * (Math.Cos(2 * Ld))) - ((0.09 / 3600) * (Math.Cos(2 * omega))));
            nutobl.deltapsi     = deg2rad(((-17.2 / 3600) * (Math.Sin(omega))) - ((1.32 / 3600) * (Math.Sin(2 * L))) - ((2.23 / 3600) * (Math.Sin(2 * Ld))) + ((0.21 / 3600) * (Math.Sin(2 * omega))));

            nutobl.epsilon = nutobl.epsilon0 + nutobl.deltaepsilon;

            return(nutobl);
        }
        //Calculate the corrections in RA/Dec due to aberation
        public EquatorialCoords Aberation(EclipticalCoords sun, NutObl nutobl, double T)
        {
            EquatorialCoords delta = new EquatorialCoords();

            double k   = (20.49552 / 3600) * Math.PI / 180.0;
            double ee  = (0.016708634 - 4.2037E-05 * T - 1.267E-07 * T * T) * Math.PI / 180.0;
            double pir = (102.93735 + 1.71946 * T + 0.00046 * T * T) * Math.PI / 180.0;

            delta.ra   = (-k / Math.Cos(this.ra)) * (Math.Cos(this.ra) * Math.Cos(sun.l) * Math.Cos(nutobl.epsilon) + Math.Sin(this.ra) * Math.Sin(sun.l));
            delta.ra  += (ee * k / Math.Cos(this.dec)) * (Math.Cos(this.ra) * Math.Cos(pir) * Math.Cos(nutobl.epsilon) + Math.Sin(this.ra) * Math.Sin(pir));
            delta.dec  = ee * k * (Math.Cos(pir) * Math.Cos(nutobl.epsilon) * (Math.Tan(nutobl.epsilon) * Math.Cos(this.dec) - Math.Sin(this.ra) * Math.Sin(this.dec)) + Math.Cos(this.ra) * Math.Sin(this.dec) * Math.Sin(pir));
            delta.dec -= k * (Math.Cos(sun.l) * Math.Cos(nutobl.epsilon) * (Math.Tan(nutobl.epsilon) * Math.Cos(this.dec) - Math.Sin(this.ra) * Math.Sin(this.dec)) + Math.Cos(this.ra) * Math.Sin(this.dec) * Math.Sin(sun.l));

            ra  = ra + delta.ra;
            dec = dec + delta.dec;

            return(delta);
        }
Ejemplo n.º 8
0
        //Calculate the corrections in RA/Dec due to aberation
        public static EquatorialCoords Aberation(EquatorialCoords celest, EclipticalCoords sun, NutObl nutobl, double T)
        {
            EquatorialCoords delta = new EquatorialCoords();

            double k   = deg2rad(20.49552 / 3600);
            double ee  = deg2rad(0.016708634 - 4.2037E-05 * T - 1.267E-07 * T * T);
            double pir = deg2rad(102.93735 + 1.71946 * T + 0.00046 * T * T);

            delta.ra   = (-k / Math.Cos(celest.ra)) * (Math.Cos(celest.ra) * Math.Cos(sun.l) * Math.Cos(nutobl.epsilon) + Math.Sin(celest.ra) * Math.Sin(sun.l));
            delta.ra  += (ee * k / Math.Cos(celest.dec)) * (Math.Cos(celest.ra) * Math.Cos(pir) * Math.Cos(nutobl.epsilon) + Math.Sin(celest.ra) * Math.Sin(pir));
            delta.dec  = ee * k * (Math.Cos(pir) * Math.Cos(nutobl.epsilon) * (Math.Tan(nutobl.epsilon) * Math.Cos(celest.dec) - Math.Sin(celest.ra) * Math.Sin(celest.dec)) + Math.Cos(celest.ra) * Math.Sin(celest.dec) * Math.Sin(pir));
            delta.dec -= k * (Math.Cos(sun.l) * Math.Cos(nutobl.epsilon) * (Math.Tan(nutobl.epsilon) * Math.Cos(celest.dec) - Math.Sin(celest.ra) * Math.Sin(celest.dec)) + Math.Cos(celest.ra) * Math.Sin(celest.dec) * Math.Sin(sun.l));

            return(delta);
        }
Ejemplo n.º 9
0
        public static EclipticalCoords EquatorialToEcliptical(EquatorialCoords celest, NutObl nutobl)
        {
            EclipticalCoords coords = new EclipticalCoords();

            coords.l = Math.Atan2((Math.Sin(celest.ra) * Math.Cos(nutobl.epsilon)) + (Math.Tan(celest.dec) * Math.Sin(nutobl.epsilon)), Math.Cos(celest.ra));
            coords.b = Math.Asin((Math.Sin(celest.dec) * Math.Cos(nutobl.epsilon)) - (Math.Cos(celest.dec) * Math.Sin(nutobl.epsilon) * Math.Sin(celest.ra)));

            return(coords);
        }
Ejemplo n.º 10
0
        //Ecliptical to Celestial coordinate conversion. Epsilon (obliquity of the ecliptic) in rads
        public static EquatorialCoords EclipticalToCelestial(EclipticalCoords eclipt, NutObl nutobl)
        {
            EquatorialCoords coords = new EquatorialCoords();

            coords.ra  = Math.Atan2((Math.Sin(eclipt.l) * Math.Cos(nutobl.epsilon)) - (Math.Tan(eclipt.b) * Math.Sin(nutobl.epsilon)), Math.Cos(eclipt.l));
            coords.dec = Math.Asin((Math.Sin(eclipt.b) * Math.Cos(nutobl.epsilon)) + (Math.Cos(eclipt.b) * Math.Sin(nutobl.epsilon) * Math.Sin(eclipt.l)));

            return(coords);
        }