コード例 #1
0
        public void Ustanovka()
        {
            if (Delt1 > 87)
            {
                MessageBox.Show("Delta>87");
                return;
            }

            Calendar JDC = new Calendar(God, Mes, Den + (Hour + Min / 60.0 + Sec / 3600.0) / 24.0);
//            Calendar JD0C = new Calendar(God0, Mes0, Den0 + Hour0 / 24.0);
            
//            double AA=Den+(Hour+Min/60.0+(Sec+ds0+(JDC.juldate-JD0C.juldate)*V)/3600.0)/24.0;
//            JDC=new Calendar(God,Mes,AA);     //Какая-то хренотень
            JDC.calcdat();                              
            JDC.JULDAT();
            double D = JDC.day;
            int G = JDC.year;
            double A0=(D-Math.Truncate(D))*24;
            double H=Math.Truncate(A0);
            double A1=A0-H;
            double Mi=Math.Truncate(A1*60);
            double A2=A1-Mi/60.0;
            double S=A2*60*60;

            double Gmt=H+Mi/60.0+S/3600.0-Dt;
            double STg=JDC.startime(G,JDC.juldate,Gmt);
            double STm=STg+Lamb;
            if (STm>24) STm-=24.0;
            if (STm<0) STm+=24.0;

            double STm1=Math.Truncate(STm);
            A1=STm-STm1;
            double STm2=Math.Truncate(A1*60);
            A2=A1-STm2/60.0;
            double STm3=A2*60.0*60.0;

            double t0=(JDC.juldate-2415020.0)/36525.0;
            double mm=3.07234+0.00186*t0;
            double n=20.0467-0.0085*t0;
            double Alf=Alf1+Alf2/60.0+Alf3/3600.0;
            double Zn;
            if ((Zn_Delt==1)||(1==2/*Zn_Delt==" "*/)) Zn=1;
                    else Zn=-1;
            double Delt=Zn*(Delt1+Delt2/60.0+Delt3/3600.0);
            Calendar JDTC=new Calendar(JD_R,1,0.0);
            Mathgr Mgr=new Mathgr();
            double Alfa=Alf+(JDC.juldate-JDTC.juldate)/365.25*(mm+n/15.0*Mgr.sin(Alf*15.0)*Mgr.tn(Delt))/3600.0;
            double test_1 = (mm + n / 15.0 + Mgr.sin(Alf * 15.0) * Mgr.tn(Delt)) ;
            double Delta=Delt+(JDC.juldate-JDTC.juldate)/365.25*(n*Mgr.cos(Alf*15))/3600.0;

            t = STm - Alfa;
            if (Math.Abs(t) > 12.0) t = -24.0 * t / Math.Abs(t) + t;

            double z = Mgr.acs(Mgr.sin(Delta)*Mgr.sin(Fi)+Mgr.cos(Delta)*Mgr.cos(Fi)*Mgr.cos(t*15.0));
            if (Math.Abs(z) > 87) { MessageBox.Show("Z>87"); return; };
            double Ref = Refr(z, Temp, Dav);
            double Refa, Refd;
            if (z != 0)
            {
                A0 = Mgr.acs((Mgr.sin(Fi) - Mgr.sin(Delta) * Mgr.cos(z)) / (Mgr.cos(Delta) * Mgr.sin(z)));
                if (t != 0)
                    Refa = Ref * Mgr.sin(A0) / Mgr.cos(Delta) * t / Math.Abs(t) / 15.0;
                else
                    Refa = 0;
                Refd = Ref * Mgr.cos(A0);
            }
            else
            {
                Refa = 0;
                Refd = 0;
            }


            double tL0 = STm - (Alfa + Refa / (3600.0 * 15.0));
            if (Math.Abs(tL0) > 12.0) tL0 = -24.0 * tL0 / Math.Abs(tL0) + tL0;
            double tLOL = tL0 * 15.0;
            if (tLOL < 0)
                tLOL = -tLOL;
            else
                tLOL = 360 - tLOL;
            if (WE == "E")
                tLOL = tLOL + 180.0;
            if (tLOL > 360)
                tLOL -= 360;
            if (tLOL < 0)
                tLOL += 360.0;


            double IL0 = ESPn(JDC.juldate);
            double beta = -20.4958 / 3600.0;
            double d_alf = beta * Mgr.cos(IL0) * Mgr.cos(23.5) * Mgr.cos(Alfa) / Mgr.cos(Delta) + beta * Mgr.sin(IL0) * Mgr.sin(Alfa) / Mgr.cos(Delta);
            double d_delt = beta * Mgr.cos(IL0) * Mgr.cos(23.5) * (Mgr.tn(23.5) * Mgr.cos(Delta) - Mgr.sin(Alfa) * Mgr.sin(Delta)) + beta * Mgr.sin(IL0) * Mgr.cos(Alfa) * Mgr.sin(Delta);

            double AlfaL2 = Alfa + d_alf / 15.0 + Refa / (3600 * 15);
            tL2 = STm - AlfaL2;
            if (Math.Abs(tL2) > 12.0)
                tL2 = -24.0 * tL2 / Math.Abs(tL2) + tL2;
            tL2 = tL2 * 15.0;
            if (tL2 < 0)
                tL2 = -tL2;
            else
                tL2 = 360 - tL2;
            if (WE == "E")
                tL2 += 180;
            double D_ex_t = (ex_t * Mgr.sin(tL2 - Eex_t)) / 60.0;
            tL2 = tL2 + D_ex_t;
            if (tL2 > 360)
                tL2 -= 360;
            if (tL2 < 0)
                tL2 += 360;

            DeltaL2 = Delta + d_delt + Refd / 3600.0;
            if (WE == "W")
                DeltaL2 = DeltaL2+0.0;
            if (WE == "E")
                DeltaL2 = 180.0 - DeltaL2;


            double D_ex_d = (ex_d * Mgr.sin(DeltaL2 - Eex_d)) / 60.0;
            DeltaL2 = DeltaL2 + D_ex_d;

            double Mz=1.0/Mgr.cos(z)-40.0*Math.Exp(-2.25*Math.Log(90.0-z));



        }
コード例 #2
0
 public double startime(int y,double jdt,double gmt)
 {
     Calendar j1= new Calendar(y,1,0.0);
     double t=(j1.juldate-2415020.0)/36525.0;
     double r=6.6460656+2400.051262*t+0.00002581*t*t;
     double u=r-24*(year-1900);
     double b=24-u;
     double c=Math.Truncate(jdt-j1.juldate)*0.0657098-b; //v originale zdesi ne trunc a int()
     double d=gmt*1.002738;
     d+=c;
     if (d<0) d+=24;
     if (d>24) d-=24;
     st=d;
     return st;
 }