谁有关于日食月食的推算公式啊

1个回答

  • //------农历及日月食------//

    //角度函数

    function ang(x,t,c1,t0,t2,t3){

    return tail(c1*x)*2*PI()+t0-t2*t*t-t3*t*t*t;

    }

    //返回农历日数及日月食信息的函数,如-324.57923415,负号表示闰月,百位3表示月偏食(2为月全食,1为日食0为无食),百位及十位表示日数,小数部分是朔望时刻(单位为天,若该天不朔或望则小数部分为零)

    function lunDate(y,m,d,calType){

    var t=(y-1899.5)/100;

    var ms=floor((y-1900)*12.3685);

    var rpi=180/PI();

    var zone=8; //时区

    var f0=ang(ms,t,0,0.75933,2.172e-4,1.55e-7)+0.53058868*ms-8.37e-4*t+zone/24+0.5;

    var fc=0.1734-3.93e-4*t;

    var j0=693595+29*ms;

    var aa0=ang(ms,t,0.08084821133,359.2242/rpi,0.0000333/rpi,0.00000347/rpi);

    var ab0=ang(ms,t,7.171366127999999e-2,306.0253/rpi,-0.0107306/rpi,-0.00001236/rpi);

    var ac0=ang(ms,t,0.08519585128,21.2964/rpi,0.0016528/rpi,0.00000239/rpi);

    var leap=0; //闰月数,0则不闰

    var ecli=0; //日月食

    var lunD=-1; //农历日数

    var shuoD=0; //本阴历月的阴历朔日数

    var shuoT=0; //本阴历月的朔时刻

    var wangD=0; //本阴历月的阴历望日数

    var wangT=0; //本阴历月的望时刻

    for(var k=-1;k=0&&lunD0