中华农历论坛知识讨论区历法知识 → [原创]公开电脑医生、福星、通胜万年历2014年2月最新历算源码


  共有68103人关注过本帖树形打印

主题:[原创]公开电脑医生、福星、通胜万年历2014年2月最新历算源码

帅哥哟,离线,有人找我吗?
chwc
  31楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:31:00


function m2fm(v,fx,fs){//秒轉為分秒,fx為小數點位數,fs為1轉為"分秒"格式否則轉為"角度分秒"格式
 var gn='+';
 if(v<0) v=-v, gn='-';
 var f=floor(v/60), m=v-f*60;
 if(!fs)   return gn + f + "'"  +m.toFixed(fx) + '"' ;
 if(fs==1) return gn + f + '分' +m.toFixed(fx) + '秒';
 if(fs==2) return gn + f + 'm'  +m.toFixed(fx) + 's';
}
function hcjj(t){ //返回P03黃赤交角,t是世紀數
  var t2=t*t, t3=t2*t,t4=t3*t,t5=t4*t;
  return (84381.4060 -46.836769*t -0.0001831*t2 +0.00200340*t3 -5.76e-7*t4 -4.34e-8*t5)/rad;
}
function rad2rrad(v){//對超過-PI到PI的角度轉為-PI到PI
  v=v % (2*Math.PI);
  if(v<=-Math.PI) return v+2*Math.PI;
  if(v>Math.PI) return v-2*Math.PI;
  return v;
}
function rad2mrad(v){ //對超過0-2PI的角度轉為0-2PI
  v=v % (2*Math.PI);
  if(v<0) return v+2*Math.PI;
  return v;
}
function llrConv(JW,E){ //球面坐標旋轉、黃道赤道坐標變換,赤到黃E取負
  var r=new Array(),J=JW[0],W=JW[1];
  r[0]=atan2( sin(J)*cos(E) - tan(W)*sin(E), cos(J) );
  r[1]=asin ( cos(E)*sin(W) + sin(E)*cos(W)*sin(J)  );
  r[2]=JW[2];
  r[0]=rad2mrad(r[0]);
  return r;
}
function dt_ext(y,jsd){ var dy=(y-1820)/100; return -20+jsd*dy*dy; } //二次曲線外推
function dt_calc(y){ //世界時-原子時之差,傳入年
 var y0=dt_at[dt_at.length-2]; //表最後一年
 var t0=dt_at[dt_at.length-1]; //表最後一年的deltatT
 if(y>=y0){
  var jsd=31; //y1年之後加速估計。瑞士星曆表jsd=31,NASA網站jsd=32,skmap的jsd=29
  if(y>y0+100) return dt_ext(y,jsd);
  var v = dt_ext(y, jsd);       //二次曲線外推
  var dv= dt_ext(y0,jsd) - t0;  //ye年二次外推與te的差
  return v - dv*(y0+100-y)/100;
 }
 var i,d=dt_at;
 for(i=0;i<d.length;i+=5) if(y<d[i+5]) break;
 var t1=(y-d[i])/(d[i+5]-d[i])*10, t2=t1*t1, t3=t2*t1;
 return d[i+1] +d[i+2]*t1 +d[i+3]*t2 +d[i+4]*t3;
}
function dt_T(t){ return dt_calc(t/365.2425+2000)/86400.0; }  //傳入儒略日(2000起算),計算TD-UT(單位:日)
var XL0_xzb = new Array( //行星星曆修正
 //經(角秒),緯(角秒), 距(10-6AU)
 -0.08631, +0.00039, -0.00008,  //水星
 -0.07447, +0.00006, +0.00017,  //金星
 -0.07135, -0.00026, -0.00176,  //火星
 -0.20239, +0.00273, -0.00347,  //木星
 -0.25486, +0.00276, +0.42926,  //土星
 +0.24588, +0.00345, -14.46266, //天王星
 -0.95116, +0.02481, +58.30651  //海王星
)
function XL0_calc(xt,zn,t,n){ //xt星體,zn坐標號,t儒略世紀,n計算項數
  t/=10; //儒略千年數
  var i,j,v=0,tn=1,c;
  var F=XL0[xt],n1,n2,N;
  var n0, pn=zn*6+1, N0 = F[pn+1]-F[pn]; //N0序列總數
  for(i=0;i<6;i++,tn*=t){
    n1=F[pn+i], n2=F[pn+1+i], n0=n2-n1;
    if(!n0) continue;
    if(n<0) N=n2;  //項數
    else { N = floor(3*n*n0/N0+0.5)+n1;  if(i) N+=3;  if(N > n2) N=n2; }
    for(j=n1,c=0;j<N;j+=3) c += F[j]*Math.cos(F[j+1] +t*F[j+2]);
    v += c*tn;
  }
  v/=F[0];
  if(xt==0){ //地球
    var t2=t*t, t3=t2*t; //千年數的次方
    if(zn==0) v += (-0.0728 -2.7702*t -1.1019*t2 -0.0996*t3) / rad;
    if(zn==1) v += (+0.0000 +0.0004*t +0.0004*t2 -0.0026*t3) / rad;
    if(zn==2) v += (-0.0020 +0.0044*t +0.0213*t2 -0.0250*t3) / 1000000;
  }else{ //其它行星
    var dv = XL0_xzb[ (xt-1)*3+zn ];
    if(zn==0) v += -3*t/rad;
    if(zn==2) v += dv/1000000;
    else      v += dv/rad;
  }
  return v;
}
function gxc_sunLon(t){ //光行差,t是世紀數
  var v =-0.043126+ 628.301955*t -0.000002732*t*t; //平近點角
  var e = 0.016708634-0.000042037*t-0.0000001267*t*t;
  return  ( -20.49552 * (1+e*Math.cos(v)) )/rad; //黃經光行差
}
var nutB=new Array(//中精章動表
  2.1824,  -33.75705, 36e-6,-1720,920,
  3.5069, 1256.66393, 11e-6,-132, 57,
  1.3375,16799.4182, -51e-6, -23, 10,
  4.3649,  -67.5141,  72e-6,  21, -9,
  0.04,   -628.302,   0,     -14,  0,
  2.36,   8328.691,   0,       7,  0,
  3.46,   1884.966,   0,      -5,  2,
  5.44,  16833.175,   0,      -4,  2,
  3.69,  25128.110,   0,      -3,  0,
  3.55,    628.362,   0,       2,  0);
function nutationLon2(t){ //只計黃經章動
 var i,a, t2=t*t, dL=0, B=this.nutB;
 for(i=0;i<B.length;i+=5){
  if(i==0) a=-1.742*t; else a=0;
  dL += (B[i+3]+a) * Math.sin( B[i]+B[i+1]*t+B[i+2]*t2 );
 }
 return dL/100/rad;
}

支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  32楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:31:00


function pty_zty(t){ //時差計算(高精),t力學時儒略世紀
  var t2=t*t,t3=t2*t,t4=t3*t,t5=t4*t;
  var L = ( 1753470142 + 628331965331.8*t + 5296.74*t2 + 0.432*t3 - 0.1124*t4 - 0.00009*t5 )/1000000000 + Math.PI -20.5/rad;
  var E,dE,dL,f,z=new Array();
  dL= -17.2*Math.sin(2.1824-33.75705*t)/rad; //黃經章
  dE=   9.2*Math.cos(2.1824-33.75705*t)/rad; //交角章
  E = hcjj(t)+dE; //真黃赤交角、地球坐標
  z[0]=XL0_calc(0,0,t,50)+Math.PI+gxc_sunLon(t)+dL;
  z[1]=-( 2796*Math.cos(3.1987+8433.46616*t) +1016*Math.cos(5.4225+550.75532*t) +804*Math.cos(3.88  +522.3694*t) )/1000000000;
  z = llrConv( z, E ); //z太陽地心赤道坐標
  z[0]-=dL*Math.cos(E);
  L = rad2rrad(L-z[0]);
  return L/pi2; //單位是周天
}
function pty_zty2(t){ //時差計算(低精),誤差約在1秒內,t力學時儒略世紀數
  var L = ( 1753470142 + 628331965331.8*t + 5296.74*t*t )/1000000000 + Math.PI;
  var z=new Array();
  var E= (84381.4088 -46.836051*t)/rad;
  z[0]=XL0_calc(0,0,t,5)+Math.PI, z[1]=0; //地球坐標
  z = llrConv( z, E ); //z太陽地心赤道坐標
  L = rad2rrad(L-z[0]);
  return L/pi2; //單位是周(天)
}
function XL1_calc(zn,t,n){ //算月亮
  var ob=XL1[zn];
  var i,j,F,N,v=0,tn=1,c;
  var t2=t*t,t3=t2*t,t4=t3*t,t5=t4*t,tx=t-10;
  if(zn==0){
    v += (3.81034409 + 8399.684730072*t -3.319e-05*t2 + 3.11e-08*t3 - 2.033e-10*t4)*rad; //月球平黃經
    v += 5028.792262*t + 1.1124406*t2 + 0.00007699*t3 - 0.000023479*t4 -0.0000000178*t5;  //歲差(角秒)
    if(tx>0) v += -0.866 +1.43*tx +0.054*tx*tx; //公元3000年至5000年擬合,最大誤10角秒內
  }
  t2/=1e4,t3/=1e8,t4/=1e8;
  n*=6; if(n<0) n = ob[0].length;
  for(i=0;i<ob.length;i++,tn*=t){
   F=ob[i];
   N = floor( n*F.length/ob[0].length+0.5 );  if(i) N+=6;  if(N >= F.length) N=F.length;
   for(j=0,c=0;j<N;j+=6) c+=F[j]*Math.cos(F[j+1] +t*F[j+2] +t2*F[j+3] +t3*F[j+4] +t4*F[j+5]);
   v += c*tn;
  }
  if(zn!=2) v/=rad;
  return v;
};
function gxc_moonLon(t){ return -3.4E-6; }
var XL={ //日月星曆基本函數(日月球面坐標計算)
E_Lon:function(t,n){ return XL0_calc(0,0, t,n); }, //地球經度計算,返回Date分點黃經,傳世紀數、取項數
M_Lon:function(t,n){ return XL1_calc(0,t,n); },    //月球經度計算,返回Date分點黃經,傳世紀數,n是項數比例
//=========================
E_v:function(t){ //地球速度,t是世紀數,誤差萬分3內
 var f=628.307585*t;
 return 628.332 +21 *Math.sin(1.527+f) +0.44 *Math.sin(1.48+f*2)
         +0.129*Math.sin(5.82+f)*t +0.00055*Math.sin(4.21+f)*t*t;
},
M_v:function(t){ //月球速度,傳入世經數
  var v = 8399.71 - 914*Math.sin( 0.7848 + 8328.691425*t + 0.0001523*t*t ); //誤差小5%
  v-=179*Math.sin( 2.543  +15542.7543*t )  //誤差小0.3%
    +160*Math.sin( 0.1874 + 7214.0629*t )
    +62 *Math.sin( 3.14   +16657.3828*t )
    +34 *Math.sin( 4.827  +16866.9323*t )
    +22 *Math.sin( 4.9    +23871.4457*t )
    +12 *Math.sin( 2.59   +14914.4523*t )
    +7  *Math.sin( 0.23   + 6585.7609*t )
    +5  *Math.sin( 0.9    +25195.624 *t )
    +5  *Math.sin( 2.32   - 7700.3895*t )
    +5  *Math.sin( 3.88   + 8956.9934*t )
    +5  *Math.sin( 0.49   + 7771.3771*t );
   return v;
},
MS_aLon:function(t,Mn,Sn){ //月日視黃經差
  return this.M_Lon(t,Mn) + gxc_moonLon(t) - ( this.E_Lon(t,Sn) + gxc_sunLon(t) + Math.PI );
},
S_aLon:function(t,n){  //太陽視黃經
 return this.E_Lon(t,n) + nutationLon2(t) + gxc_sunLon(t) + Math.PI; //這里算章動耗時
},
MS_aLon_t:function(W){ //已知月日視黃經差求時間
  var t,v= 7771.37714500204;
  t  = ( W + 1.08472               )/v;
  t += ( W - this.MS_aLon(t, 3, 3) )/v; v=this.M_v(t)-this.E_v(t);  //v的精度0.5%
  t += ( W - this.MS_aLon(t,20,10) )/v;
  t += ( W - this.MS_aLon(t,-1,60) )/v;
  return t;
},
S_aLon_t:function(W){ //已知太陽視黃經反求時間
  var t,v= 628.3319653318;
  t  = ( W - 1.75347-Math.PI   )/v; v=this.E_v(t); //v的精度0.03%,詳見許先生原文
  t += ( W - this.S_aLon(t,10) )/v; v=this.E_v(t); //再算一次提高精度,不算也可
  t += ( W - this.S_aLon(t,-1) )/v;
  return t;
},
MS_aLon_t2:function(W){ //已知月日視黃經差求時間,高速低精度,誤差不超過600秒(只驗算幾千年)
  var t,v = 7771.37714500204;
  t  = ( W + 1.08472 )/v;
  var L,t2 = t*t;
  t -= ( -0.00003309*t2 + 0.10976*Math.cos( 0.784758 + 8328.6914246*t + 0.000152292*t2 ) + 0.02224 *Math.cos( 0.18740  + 7214.0628654*t - 0.00021848 *t2 ) - 0.03342 *Math.cos( 4.669257 + 628.307585*t ) )/v;
  L = this.M_Lon(t,20) - (4.8950632+ 628.3319653318*t + 0.000005297*t*t + 0.0334166*Math.cos(4.669257+628.307585*t) + 0.0002061*Math.cos(2.67823+628.307585*t)*t + 0.000349*Math.cos(4.6261+1256.61517*t) - 20.5/rad);
  v = 7771.38 - 914*Math.sin( 0.7848 + 8328.691425*t + 0.0001523*t*t ) - 179*Math.sin( 2.543 + 15542.7543*t ) - 160*Math.sin( 0.1874 + 7214.0629*t );
  t += ( W - L )/v;
  return t;
},
S_aLon_t2:function(W){ //已知太陽視黃經反求時間,高速低精度,最大誤差不超600秒
  var t,L,v= 628.3319653318;
  t =  ( W - 1.75347-Math.PI )/v;
  t -= ( 0.000005297*t*t + 0.0334166 * Math.cos( 4.669257 + 628.307585*t) + 0.0002061 * Math.cos( 2.67823  + 628.307585*t)*t )/v;
  t += ( W - this.E_Lon(t,8) - Math.PI + (20.5+17.2*Math.sin(2.1824-33.75705*t))/rad )/v;
  return t;
},
moonIll:function(t){ //月亮被照亮部分的比例
 var t2 = t*t, t3 =t2*t, t4 = t3*t;
 var D,M,m,a, dm=Math.PI/180;
 D = (297.8502042 + 445267.1115168*t - 0.0016300*t2 + t3/545868 - t4/113065000)*dm; //日月平距角
 M = (357.5291092 +  35999.0502909*t - 0.0001536*t2 + t3/24490000             )*dm; //太陽平近點
 m = (134.9634114 + 477198.8676313*t + 0.0089970*t2 + t3/69699 - t4/14712000  )*dm; //月亮平近點
 a = Math.PI - D + (-6.289*Math.sin(m) +2.100*Math.sin(M) -1.274*Math.sin(D*2-m) -0.658*Math.sin(D*2) -0.214*Math.sin(m*2) -0.110*Math.sin(D))*dm;
 return (1+Math.cos(a))/2;
}
};
function qi_high(W){ //高精度氣1999年春分=0
 var wqa=W* Math.PI/12;
  var t = XL.S_aLon_t2(wqa)*36525;
  t = t - dt_T(t)+8/24;
  var v = ( (t+0.5) %1 ) * 86400;
  if(v<1200 || v >86400-1200) t = XL.S_aLon_t(wqa)*36525 - dt_T(t)+8/24;
  return  t+2451545+0.5;
 }
function so_high(W){ //高精度朔2000年1月7號哪次朔=0
 var wa=(W*Math.PI*2);
  var t = XL.MS_aLon_t2(wa)*36525;
  t = t - dt_T(t)+8/24;
  var v = ( (t+0.5) %1 ) * 86400;
  if(v<1800 || v >86400-1800) t = XL.MS_aLon_t(wa)*36525 - dt_T(t)+8/24;
  return  t+2451545+0.5;
 }
function suoCalc(k,jiao){ //定朔函數
var i,r,T,s2="";
  T = XL.MS_aLon_t( (k+jiao/360)*2*Math.PI );  //精確時間計算,入口參數是當年各朔望黃經
  s2 += ( T*36525+2451545+8/24-dt_T(T*36525)+0.5 );
return s2;
}
function qiCalc(n){ //定氣函數
 var i,T,s="",s2="";
  T = XL.S_aLon_t( (n*15/360)*2*Math.PI );    //精節氣時間計算
  s2+=( T*36525+2451545+8/24-dt_T(T*36525)+0.5 );
 return s2;
}

支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  33楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:33:00

//=========日月升降(許劍偉先生提供的數據代碼,我有改動,因我摻合了天文臺的數據)=============
var SZJ={//日月的升中天降,不考慮氣溫和氣壓的影響
 L  : 0,  //站點經度,向東測為正
 fa : 0,  //站點緯度
 dt : 0,  //TD-UT
 E  : 0.409092614, //黃赤交角
 getH:function(h,w){ //h地平緯度,w赤緯,返回時角
  var c = ( Math.sin(h) - Math.sin(this.fa)*Math.sin(w) ) / Math.cos(this.fa)/Math.cos(w);
  if(Math.abs(c)>1) return Math.PI;
  return Math.acos(c);
 },
 Mcoord:function(jd,H0,r){ //章動同時影響恒星時和天體坐標,所以不計算章動。返回時角及赤經緯
   var z = m_coord( (jd+this.dt)/36525, 40,30,8 ); //低精度月亮赤經緯
   z = llrConv( z, this.E ); //轉為赤道坐標
   r.H = rad2rrad( pGST(jd,this.dt) + this.L - z[0] ); //得到此刻天體時角
   if(H0) r.H0 = this.getH( 0.7275*cs_rEar/z[2]-34*60/rad, z[1] ); //升起對應的時角
 },
 Mt : function(jd){ //月亮到中升降時刻計算,傳入jd含義與St()函數相同
  this.dt = dt_T(jd);
  this.E  = hcjj(jd/36525);
  jd -= mod2(0.1726222 + 0.966136808032357*jd - 0.0366*this.dt + this.L/pi2, 1); //查找最靠近當日中午的月上中天,mod2的第1參數為本地時角近似值
  var r = new Array(), sv = pi2*0.966;
  r.z = r.x = r.s = r.j = r.c = r.h = jd;
  this.Mcoord(jd,1,r); //月亮坐標
  r.s += (-r.H0 - r.H )/sv;
  r.j += ( r.H0 - r.H )/sv;
  r.z += (    0 - r.H )/sv;
  r.x += ( Math.PI - r.H )/sv;
  this.Mcoord(r.s,1,r);  r.s += rad2rrad( -r.H0 - r.H )/sv;
  this.Mcoord(r.j,1,r);  r.j += rad2rrad( +r.H0 - r.H )/sv;
  this.Mcoord(r.z,0,r);  r.z += rad2rrad(     0 - r.H )/sv;
  this.Mcoord(r.x,0,r);  r.x += rad2rrad( Math.PI - r.H )/sv;
  return r;
 },
 Scoord:function(jd,xm,r){ //章動同時影響恒星時和天體坐標,所以不計算章動。返回時角及赤經緯
   var z = new Array( XL.E_Lon( (jd+this.dt)/36525, 5 ) + Math.PI - 20.5/rad, 0,1);  //太陽坐標(修正了光行差)
   z = llrConv( z, this.E ); //轉為赤道坐標
   r.H = rad2rrad( pGST(jd,this.dt) + this.L - z[0] ); //得到此刻天體時角
   if(xm==10||xm==1) r.H1 = this.getH(-50*60/rad,  z[1]); //地平以下50分
   if(xm==10||xm==2) r.H2 = this.getH(-6*3600/rad, z[1]); //地平以下6度
   if(xm==10||xm==3) r.H3 = this.getH(-12*3600/rad,z[1]); //地平以下12度
   if(xm==10||xm==4) r.H4 = this.getH(-18*3600/rad,z[1]); //地平以下18度
 },
 St : function(jd){ //太陽到中升降時刻計算,傳入jd是當地中午12點時間對應的2000年首起算的格林尼治時間UT
  this.dt = dt_T(jd);
  this.E  = hcjj(jd/36525);
  jd -= mod2(jd + this.L/pi2, 1); //查找最靠近當日中午的日上中天,mod2的第1參數為本地時角近似值
  var r = new Array(), sv = pi2;
  r.z = r.x = r.s = r.j = r.c = r.h = r.c2 = r.h2 = r.c3 = r.h3 = jd; r.sm = '';
  this.Scoord(jd,10,r); //太陽坐標
  r.s += (-r.H1 - r.H )/sv; //升起
  r.j += ( r.H1 - r.H )/sv; //降落
  r.c += (-r.H2 - r.H )/sv; //民用晨
  r.h += ( r.H2 - r.H )/sv; //民用昏
  r.c2+= (-r.H3 - r.H )/sv; //航海晨
  r.h2+= ( r.H3 - r.H )/sv; //航海昏
  r.c3+= (-r.H4 - r.H )/sv; //天文晨
  r.h3+= ( r.H4 - r.H )/sv; //天文昏
  r.z += (    0 - r.H )/sv; //中天
  r.x += ( Math.PI - r.H )/sv; //下中天
  this.Scoord(r.s,1,r);  r.s += rad2rrad( -r.H1 - r.H )/sv;  if(r.H1==Math.PI) r.sm += '無升起.';
  this.Scoord(r.j,1,r);  r.j += rad2rrad( +r.H1 - r.H )/sv;  if(r.H1==Math.PI) r.sm += '無降落.';

  this.Scoord(r.c, 2,r); r.c += rad2rrad( -r.H2 - r.H )/sv;  if(r.H2==Math.PI) r.sm += '無民用晨.';
  this.Scoord(r.h, 2,r); r.h += rad2rrad( +r.H2 - r.H )/sv;  if(r.H2==Math.PI) r.sm += '無民用昏.';
  this.Scoord(r.c2,3,r); r.c2+= rad2rrad( -r.H3 - r.H )/sv;  if(r.H3==Math.PI) r.sm += '無航海晨.';
  this.Scoord(r.h2,3,r); r.h2+= rad2rrad( +r.H3 - r.H )/sv;  if(r.H3==Math.PI) r.sm += '無航海昏.';
  this.Scoord(r.c3,4,r); r.c3+= rad2rrad( -r.H4 - r.H )/sv;  if(r.H4==Math.PI) r.sm += '無天文晨.';
  this.Scoord(r.h3,4,r); r.h3+= rad2rrad( +r.H4 - r.H )/sv;  if(r.H4==Math.PI) r.sm += '無天文昏.';

  this.Scoord(r.z,0,r);  r.z += (     0 - r.H )/sv;
  this.Scoord(r.x,0,r);  r.x += rad2rrad( Math.PI - r.H )/sv;
  return r;
 },

 rts:new Array(),//多天的升中降
 calcRTS:function(jd,n,Jdl,Wdl,sq){ //jd是當地起始略日(中午時刻),sq是時區
  var i,c,r;
   if(!this.rts.length) {for(i=0;i<32;i++) this.rts[i] = new Array(); }
  this.L = Jdl, this.fa = Wdl, sq/=24; //設置站點參數
  for(i=0;i<=n+1;i++){ r=this.rts[i];  r.Ms=r.Mz=r.Mx=r.Mj="--:--:--"; }
  for(i=-1;i<=n;i++){
   if(i>=0&&i<n){ //太陽
    r = SZJ.St(jd+i+sq);this.Scoord(jd,10,r);
    this.rts[i].s = dToStr(tail(r.s-sq+0.5)); //升
    this.rts[i].z = dToStr(tail(r.z-sq+0.5)); //中
    this.rts[i].x = dToStr(tail(r.x-sq+0.5)); //下中
    this.rts[i].j = dToStr(tail(r.j-sq+0.5)); //降
    this.rts[i].c = dToStr(tail(r.c-sq+0.5)); //晨
    this.rts[i].h = dToStr(tail(r.h-sq+0.5)); //昏
    this.rts[i].ch = dToStr(tail(r.h-r.c)); //光照時間
    this.rts[i].sj = dToStr(tail(r.j-r.s)); //晝長
    this.rts[i].sm =r.sm;}
   r = SZJ.Mt(jd+i+sq); //月亮
   c=floor(r.s-sq+0.5)-jd;  if(c>=0&&c<n) this.rts[c].Ms = dToStr(tail(r.s-sq+0.5));
   c=floor(r.z-sq+0.5)-jd;  if(c>=0&&c<n) this.rts[c].Mz = dToStr(tail(r.z-sq+0.5));
   c=floor(r.x-sq+0.5)-jd; if(c>=0&&c<n) this.rts[c].Mx = dToStr(tail(r.x-sq+0.5));
   c=floor(r.j-sq+0.5)-jd;  if(c>=0&&c<n) this.rts[c].Mj = dToStr(tail(r.j-sq+0.5));
  }
  this.rts.dn = n;
 }
};
function RTS2(jd,vJ,vW,tz){
  SZJ.L  = vJ/radd; //設置站點參數
  SZJ.fa = vW/radd;
  var sq = SZJ.L/pi2*24;
  var s="",sm="",sn="", r,rm,sqa=vJ/15,c=J2000+sqa/24,sqc=(8-sqa)/24;var sqc2='減';var sqc2a='加上';if(sqc<0)sqc2='加',sqc2a='減去';var sqc2b=dToStr((abs(sqc)));
  r=SZJ.St(jd-sq/24);var nbw='北緯';if(vW<0)nbw='南緯';if(vW==0)nbw='南北緯=';var dxj='東經';if(vJ<0)dxj='西經';if(vJ==0)dxj='東西經';
  s +="太陽升起" + dToStr(tail(r.s+c+0.5)) + " 太陽降落 " + dToStr(tail(r.j+c+0.5))+"<br>";
  sm +="航海天亮 " + dToStr(tail(r.c2+c+0.5))+ " 航海天黑 " + dToStr(tail(r.h2+c+0.5))+" ";
  sm +="天文天亮 " + dToStr(tail(r.c3+c+0.5))+ " 天文天黑 " + dToStr(tail(r.h3+c+0.5))+"<br>";
  rm=SZJ.Mt(jd-sq/24);var zhusi="<br>另:計算不考慮海拔高度和空氣密度等因素影響。";
  s +="月亮升起 " + dToStr(tail(rm.s+c+0.5)) + " 月亮降落 " + dToStr(tail(rm.j+c+0.5))+" ";
  s +="月上中天 " + dToStr(tail(rm.z+c+0.5)) + " 月下中天 " + dToStr(tail(rm.x+c+0.5))+"<br>";
 if(r.sm) s = '在極地晝夜期(註:夏晝,冬夜)<br>極地夏季太陽、冬季月亮在天上或在地平線轉圈,無日月出落時間<br>';
 return dxj+vJ+'度 '+nbw+vW+'度日月升降補充:<br>'+s+sn+sm+'◆以上本地時間要轉為中國通用的東8區(東經120°)時間請:'+sqc2a+sqc2b+zhusi;
}
function RTS1(jd,vJ,vW,tz){
 SZJ.calcRTS(jd, 2, (vJ/180*Math.PI), (vW/180*Math.PI), (tz*-1)); //升降計算,使用北時時間,tz=-8指東8區,jd+tz應在當地正午左右(誤差數小時不要緊)
 var s, ob = SZJ.rts[0];var sqa=vJ/15,c=J2000+sqa/24,sqc=(8-sqa)/24;var sqc2='減';var sqc2a='加上';if(sqc<0)sqc2='加',sqc2a='減去';var sqc2b=dToStr((abs(sqc)));
 s  = '日出 <font color=red>'+ob.s + '</font> 日落 '+ob.j +' 日上中天 '+ob.z +' 日下中天 '+ob.x +'<br>';
 s += '月出 '+ob.Ms+ ' 月落 '+ob.Mj+' 月上中天 '+ob.Mz+' 月下中天 '+ob.Mx+'<br>';
 s += '天亮 '+ob.c + ' 天黑 '+ob.h +'';
 s += '日照時間 '+ob.sj+ ' 白天長度 '+ob.ch+'<br>';
 if(ob.sm)s='在極地晝夜期(註:夏晝,冬夜)<br>極地夏季太陽、冬季月亮在天上或在地平線轉圈<br>無日月出落時間,無晨昏時間<br>';
 var v=s;
 return v;
}
 function zdysi2(y1,m1,d1,h1,mi1,sec,zone){
 var mi2=abs(mi1);var jd=JD(y1,m1,d1,h1,mi2,sec,zone)+0.000000001;var Jw=zone*15;
 var J=Jw/radd;var Jwts=abs(round(Jw*10000)/10000);
 var jda2=jd-2451545;var jda2a=jda2;
 var jd2 = jda2+dt_T(jda2);//力學時
 var jd9 =pty_zty(jd2/36525);var dtu=dt_T(jd2);
 jda2 += jd9+J/Math.PI/2+0.5;
 var jda2a=jd-2451545+J/Math.PI/2+0.5;
 var jd4=tail(jda2); var jd5=dToStr(jd4);var jd6=dToStr(tail(jda2a));
 var dxjm=(Jw>0)?'東經':'西經';if(Jw==0)dxjm='東西經';var jd7=m2fm(jd9*86400,2,1);
 var zsqc=(zone-8)/24;var sqc4a='減';if(zsqc<0)sqc4a='加';var sqc3b=dToStr(abs(zsqc));
 var dxts='<a tips6="補充:<br>1、真太陽時與平太陽時時差:'+jd7+'<br>2、中國通用時間(東經120°時間)與'+dxjm+Jwts+'°的本地時間差:'+sqc4a+sqc3b+'<br>3、要轉為中國通用的北京標準時間(120°時間)請:'+sqc4a+sqc3b;
 dxts += '<br>4、ΔT=' + (dtu*86400).toFixed(2) +'秒">';
 var vd=dxts+dxjm+Jwts+'°時間'+jd6+'(<font color="#FF0000">'+dxts+'真太陽時'+jd5+'</a></font>)</a>';
 return vd;
 }

 function zdysi3(jd,zone,faW,kka,jda3){
 var Jw=zone*15;var sqa=Jw/15,c=J2000+sqa/24,sqc=(8-sqa)/24;var sqc2='減';var sqc2a='加上';if(sqc<0)sqc2='加',sqc2a='減去';var sqc2b=dToStr((abs(sqc)));
 var jda2=jd-2451545+0.0000000001;var jda2a=jda2;var smsja=(kka==1)?RTS1(jda3,Jw,faW,zone)+'<br>'+RTS2(jda3,Jw,faW,zone):'<a tips8="'+RTS2(jda3,Jw,faW,zone)+'">'+RTS1(jda3,Jw,faW,zone)+'</a>';
 var jd2 = jda2+dt_T(jda2); //力學時
 var L=Jw/180*Math.PI;var fa=faW/180*Math.PI;var high=0;
  this.T=jd2, this.L=L, this.fa=fa;
  this.dt = dt_T(T); //TD-UT
  this.jd = T - this.dt;    //UT
  T/=36525;
  var zd = nutation2(T);
  this.dL = zd[0];   //黃經章
  this.dE = zd[1];   //交角章動
  this.E  = hcjj(T) + this.dE; //真黃赤交角
  this.gst= pGST(this.jd,this.dt) + this.dL*Math.cos(this.E); //真恒星時(不考慮非多項式部分)
  var z=new Array();
  //=======月亮========
  //月亮黃道坐標
  z=m_coord(T,-1,-1,-1); //月球坐標
  z[0]  = rad2mrad( z[0]+gxc_moonLon(T)+this.dL );  z[1] += gxc_moonLat(T);  //補上月球光行差及章動
  this.mHJ = z[0]; this.mHW = z[1]; this.mR  = z[2]; //月球視黃經,視黃緯,地月質心距

  //月球赤道坐標
  z = llrConv( z, this.E ); //轉為赤道坐標
  this.mCJ = z[0]; this.mCW = z[1]; //月球視赤經,月球赤緯

  //月亮時角計算
  this.mShiJ = rad2mrad(this.gst + L - z[0]); //得到此刻天體時角
  if( this.mShiJ>Math.PI ) this.mShiJ -= pi2;

  //修正了視差的赤道坐標
  parallax(z, this.mShiJ,fa, high); //視差修正
  this.mCJ2 = z[0], this.mCW2 = z[1], this.mR2=z[2];

  //月亮時角坐標
  z[0] += Math.PI/2-this.gst-L;  //轉到相對於地平赤道分點的赤道坐標(時角坐標)

  //月亮地平坐標
  z = llrConv (z, Math.PI/2-fa );    //轉到地平坐標(只改經緯度)
  z[0] = rad2mrad( Math.PI/2-z[0] );
  this.mDJ = z[0]; this.mDW = z[1]; //方位角,高度角
  if(z[1]>0) z[1] += MQC(z[1]); //大氣折射修正
  this.mPJ = z[0]; this.mPW = z[1]; //方位角,高度角

  //=======太陽========
  //太陽黃道坐標
  z = e_coord(T,-1,-1,-1);   //地球坐標
  z[0]  = rad2mrad(z[0]+Math.PI+gxc_sunLon(T)+this.dL);  //補上太陽光行差及章動
  z[1]  =-z[1] + gxc_sunLat(T); //z數組為太陽地心黃道視坐標
  this.sHJ = z[0]; this.sHW = z[1]; this.sR  = z[2]; //太陽視黃經,視黃緯,日地質心距

 


支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  34楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:33:00

//太陽赤道坐標
  z = llrConv( z, this.E ); //轉為赤道坐標
  this.sCJ = z[0]; this.sCW = z[1]; //太陽視赤經,視赤緯

  //太陽時角計算
  this.sShiJ = rad2mrad(this.gst + L - z[0]); //得到此刻天體時角
  if( this.sShiJ>Math.PI ) this.sShiJ -= pi2;

  //修正了視差的赤道坐標
  parallax(z,this.sShiJ,fa,high); //視差修正
  this.sCJ2=z[0], this.sCW2=z[1], this.sR2=z[2];

  //太陽時角坐標
  z[0] += Math.PI/2-this.gst-L;  //轉到相對於地平赤道分點的赤道坐標

  //太陽地平坐標
  z = llrConv( z, Math.PI/2-fa );
  z[0] = rad2mrad( Math.PI/2-z[0] );
  this.sDJ = z[0]; this.sDW = z[1]; //方位角,高度角

  if(z[1]>0) z[1] += MQC(z[1]); //大氣折射修正
  this.sPJ = z[0]; this.sPW = z[1]; //方位角,高度角

  //=======其它========
  //時差計算
  var t=T/10, t2=t*t,t3=t2*t,t4=t3*t,t5=t4*t;
  var Lon = ( 1753470142 + 6283319653318*t + 529674*t2 + 432*t3 - 1124*t4 - 9*t5 )/1000000000 + Math.PI - 20.5/rad; //修正了光行差的太陽平黃經
  Lon = rad2mrad( Lon - (this.sCJ-this.dL*Math.cos(this.E)) ); //(修正了光行差的平黃經)-(不含dL*cos(E)的視赤經)
  if(Lon>Math.PI) Lon-=pi2; //得到時差,單位是弧度
  this.sc  = Lon/pi2;   //時差(單位:日)

  //真太陽與平太陽
  this.pty = this.jd+L/pi2;  //平太陽時'+dToStr(tail(this.pty+0.5))+'
  this.zty = this.jd+L/pi2+this.sc; //真太陽時
  this.mIll = XL.moonIll(T); //月亮被照面比例
  //時差計算
  var t=T/10, t2=t*t,t3=t2*t,t4=t3*t,t5=t4*t;
  var Lon = ( 1753470142 + 6283319653318*t + 529674*t2 + 432*t3 - 1124*t4 - 9*t5 )/1000000000 + Math.PI - 20.5/rad; //修正了光行差的太陽平黃經
  Lon = rad2mrad( Lon - (this.sCJ-this.dL*Math.cos(this.E)) ); //(修正了光行差的平黃經)-(不含dL*cos(E)的視赤經)
  if(Lon>Math.PI) Lon-=pi2; //得到時差,單位是弧度
  this.sc  = Lon/pi2;   //時差(單位:日)

  var rzl='太陽:視黃經 ' + rad2str(this.sHJ,0)+'視黃緯 ' + rad2str(this.sHW,0) +'視赤經 ' + rad2str(this.sCJ,1) +'視赤緯 ' + rad2str(this.sCW,0) +'<br>太陽:方位角 '+rad2str(this.sPJ,0)+'高度角 '+rad2str(this.sPW,0)+'時角 ' +rad2str(this.sShiJ,0)+'<br>月亮:視黃經 ' + rad2str(this.mHJ,0)+'視黃緯 ' + rad2str(this.mHW,0) +'視赤經 ' + rad2str(this.mCJ,1) +'視赤緯 ' + rad2str(this.mCW,0) +'<br>月亮:方位角 '+rad2str(this.mPJ,0)+'高度角 '+rad2str(this.mPW,0)+'時角 ' +rad2str(this.mShiJ,0);
  var vzl2='月被照亮:'+(this.mIll*100).toFixed(3)+'% 地月距離≈'+this.mR.toFixed(2)+'千米.日地距離≈'+(this.sR*149597870).toFixed(2)+'千米';

  var vzl=(kka==1)?'<font color=#000080>'+vzl2+'</font><br><font color=#800080>經'+rad2str2(L)+'緯'+rad2str2(fa)+'</font>的坐標:地方平太陽時:'+dToStr(tail(this.pty+0.5))+'(<font color="#FF0000">地方真太陽時:'+dToStr(tail(this.zty+0.5))+'</font>,時差:'+m2fm(this.sc*86400,2,1)+',ΔT=' + (this.dt*86400).toFixed(2) +'秒)<br><font color=#000040><a tips8="經'+Jw+'緯'+faW+'計算的日月升降<br>'+smsja+'">'+rzl+'</a></font>':'<font color=#500000>'+smsja+'</font><font color=#FF0000><a tips7="<span class=zh12>'+'經'+Jw+'緯'+faW+'補充:<br>'+rzl+'</span>">註:日月出落是當地平太陽時,轉東經120°(中國通用時間):'+sqc2a+sqc2b+'</a></font><br><a tips7="<span class=zh12>'+'經'+Jw+'緯'+faW+'補充:<br>'+rzl+'</span>">'+vzl2+'</a>';
 return vzl;
 }


支持(0中立(0反对(1单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  35楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:33:00

//-----農曆節氣計算---//
   var qiS='ocFs22AFsckF2tsDtFqEt2aposFdFgiFseFtmelsssEfhkF2anmelpFlF1ikrotcnEqEq2FfqmcDsrFor22FgFrcDocFs22FgEeFtE2sfFs22sCoEsaF2tsD1FpeE2eFsssEciFsFnmelpFcFhkF2tcnEqEpFgkrotcnEqrEtFermcDsrcFs22FgBmcmr22DaDsaF222sD1FpeForeF2tssEfiFpEoeFssD1iFstC2pDgkF2tcnEqEpFg11FscnEqrAoAF2VBtAFrADlFoAkAEpAEgyoFgBiBqAenBaBoqxCdxDklEqCpE1BqVFgEiDrACdVf1VCgxeBbCaCiEifAE2VBa1C1EdEdFdixCoCeE1ADiEifDaVCdBg1FbCbFbcyDdDgiFaAC2VqzzzyEtzzVBbA';//2018,11(8952)
   var qijz=jieya(qiS);
function qij(k){ ///1646年到1960年1月史實定氣修正
  var v2='';var v=qijz.charAt(k);//if(k==7993||k==14034||k==14688||k==15654)v=0;if(k==13278||k==14070||k==14553)v=2;
  if(v=='1')
    v2=1;
  if(v=='2')
    v2=-1;
  if(v==''||v=='0')
    v2=0;
  return parseInt(v2);
 }
  var ykche=new Array(//史實平氣dj起點數
  1640650.479938,1642476.703182,1683430.515601,1752157.640664,1807675.003759,1883627.765182,1907369.128100,1936603.140413,1939145.524180,1947180.798300,1964362.041824,1987372.340971,
  1999653.819126,2007445.469786,2021324.917146,2047257.232342,2070282.898213,2073204.872850,2080144.500926,2086703.688963,2110033.182763,2111190.300888,2113731.271005,2120670.840263,2123973.309063,
  2125068.997336,2136026.312633,2156099.495538,2159021.324663,2162308.575254,2178485.706538,2178759.662849,2185334.020800,2187525.481425,2188621.191481,
  0,1802546.326725,1883631.42057150,1886185.42664605,1912116.914243,1926361.952671,1927821.753701,1921979.518308,1934396.468788,2067345.7182853,2085242.2187370);
  var jkche=new Array(//史實平氣長度
  15.21842500,15.21874996, 15.218750011,15.218749978,15.218620279,15.218612292,15.218449176,15.218425000,15.218466998, 15.218524844,15.218533526,15.218513908,15.218530782,
  15.218535181,15.218526248,15.218519654,15.218425000,15.218515221,15.218530782,15.218523776,15.218425000,15.218425000,15.218515671,15.218425000,15.218425000,15.218477932,15.218472436,
  15.218425000,15.218425000,15.218461742,15.218425000,15.218445786,15.218425000,15.218425000,15.218437484,
  0,15.2186901,15.218620279,15.21866250,15.21866,15.218449176,15.21845,15.218565,15.218425,15.218549654,15.21858705);
  var jkche2=new Array(//史實平氣起算點節數
  -53265,-53145,-50454,-45938,-42290,-37299,-35739,-33818,-33651,-33123,-31994,-30482,-29675,-29163,-28251,-26547,-25034,-24842,-24386,-23955,-22422,-22346,-22179,-21723,-21506,-21434,-20714,-19395,-19203,-18987,-17924,-17906,-17474,-17330,-17258,
  0,-42627,-37299,-37131,-35427,-34491,-34395,-34779,-33963,-25227,-24051);
 //
 function S(y,n,pd){//pd取值0或1,分別表示平氣和定氣,該函數返回節氣的D0值
  var vj='';var vaj='';var ykd=(erJD(y,1,1))-1;
  var n0=24*(y-1999)-6+n;if(liza==0&&n0>=-8475)vaj=-1;if(liza==1&&n0>=-7563)vaj=-1;if(liza==2&&n0>=-8475)vaj=-1;
  var ydk=24*(y-1646);var ydk2=(ydk+n-1);var ydk3=qij(ydk2);var vsb0=0;if(ydk3==-1)vsb0=0.952;if(ydk3==1)vsb0=0.0007;
  var vsa=qiCalc(n0)-ykd;//現代高精定氣d0值
  if(y>=1646&&y<1961&&vaj==-1){//史實擬合
  var yk=365.2423112;var jjk=0.00000001;///yk=365.2422226;
  var yk2=yk-0-0-0-0-jjk;
  var juD=y*(yk2-6.4e-14*(y-100)*(y-100)-3.047e-8*(y-100))+15.218427*n+1721050.71301;//儒略日
  var tht=3e-4*y-0.372781384-0.2617913325*n;//角度
  var yrD=(1.945*sin(tht)-0.01206*sin(2*tht))*(1.048994-2.583e-5*y);//年差均數
  var shuoD=-18e-4*sin(2.313908653*y-0.439822951-3.0443*n);//朔差均
  vj=(vsb0==0)?(juD+yrD+shuoD-erD(y,1,0)-1721425)+(ydk3):floor((juD+yrD+shuoD-erD(y,1,0)-1721425)+(ydk3))+vsb0;//古代史實定氣d0值
  }else{
  var jkk=-1;var jqka=0;
   if(n0>=-53265)jkk=0;//-221-11-09 h=0.01709 古曆·秦漢
   if(n0>=-53145)jkk=1;//-216-11-09 h=0.01557 古曆·秦漢
   if(n0>=-50453)jkk=2;//-104-12-25 h=0.01560 漢書<太初曆>年策=365.25000
   if(n0>=-45938)jkk=3;//85-02-23 h=0.01559 後漢書<四分曆>年策=365.25000
   if(n0>=-42290)jkk=4;//237-02-22 h=0.00010 晉書<景初曆>年策=365.24689
   if(n0>=-37299)jkk=5;//445-02-03 h=0.00026 宋書<何承天元嘉曆>年策=365.24670
   if(n0>=-35739)jkk=6;//510-02-03 h=0.00027 宋書<祖沖之大明曆>年策=365.24278
   if(n0>=-33818)jkk=7;//590-02-17 h=0.00149 隋書<開皇曆>年策=365.24220
   if(n0>=-33651)jkk=8;//597-02-03 h=0.00121 隋書<大業曆>年策=365.24321
   if(n0>=-33123)jkk=9;//619-02-03 h=0.00052 新唐書<戊寅元曆)平氣定朔 年策=365.24460
   if(n0>=-31994)jkk=10;//666-02-17 h=0.00059 新唐書<麟德曆>年策=365.24480
   if(n0>=-30482)jkk=11;//729-02-16 h=0.00096 新唐書<大衍曆,至德曆>年策=365.24433
   if(n0>=-29675)jkk=12;//762-10-03 h=0.00093 新唐書<五紀曆>年策=365.24474
   if(n0>=-29163)jkk=13;//784-02-01 h=0.00059 新唐書<正元,觀象曆>年策=365.24484
   if(n0>=-28251)jkk=14;//822-02-01 h=0.00022 新唐書<宣明曆>年策=365.24463
   if(n0>=-26547)jkk=15;//893-01-31 h=0.00015 新唐書<崇玄,調元曆>年策=365.24447
   if(n0>=-25034)jkk=16;//956-02-16 h=0.00149 舊五代<欽天曆>年策=365.24220
   if(n0>=-24842)jkk=17;//964-02-16 h=0.00166 宋史<應天曆>年策=365.24437
   if(n0>=-24386)jkk=18;//983-02-16 h=0.00093 宋史<乾元曆>年策=365.24474
   if(n0>=-23955)jkk=19;//1001-01-31 h=0.00067 宋史<儀天曆,崇天曆>年策=365.24457
   if(n0>=-22422)jkk=20;//1064-12-15 h=0.00669 宋史<明天曆>年策=365.24220
   if(n0>=-22346)jkk=21;//1068-02-15 h=0.00149 宋史<崇天曆>年策=365.24220
   if(n0>=-22179)jkk=22;//1075-01-30 h=0.00038 李銳補修<奉元曆>年策=365.24438
   if(n0>=-21723)jkk=23;//1094-01-30 h=0.00149 宋史<觀天曆>年策=365.24220
   if(n0>=-21506)jkk=24;//1103-02-14 h=0.00669 李銳補修<占天曆>年策=365.24220
   if(n0>=-21434)jkk=25;//1106-02-14 h=0.00056 宋史<紀元曆>年策=365.24347
   if(n0>=-20714)jkk=26;//1136-02-14 h=0.00088 宋史<統元曆,乾道曆,淳熙曆>年策=365.24334
   if(n0>=-19395)jkk=27;//1191-01-29 h=0.00149 宋史<會元曆>年策=365.24220
   if(n0>=-19203)jkk=28;//1199-01-29 h=0.00149 宋史<統天曆>年策=365.24220
   if(n0>=-18987)jkk=29;//1208-01-30 h=0.00146 宋史<開禧曆>年策=365.24308
   if(n0>=-17924)jkk=30;//1252-05-15 h=0.04606 淳祐曆 年策=365.24220
   if(n0>=-17906)jkk=31;//1253-02-13 h=0.00231 會天曆 年策=365.24270
   if(n0>=-17474)jkk=32;//1271-02-13 h=0.00520 宋史<成天曆>年策=365.24220
   if(n0>=-17330)jkk=33;//1277-02-12 h=0.00520 本天曆 年策=365.24220
   if(n0>=-17258)jkk=34;//1280-02-13 h=0.00015 元史<授時曆>年策=365.24250
   if(n0>=-8475)jkk=-1; //平氣結束
   if(liza==1&&(n0>=-42627&&n0<-41235))jkk=36;//223 吳<乾象曆>年策=365.24688
   if(liza==1&&(n0>=-37299&&n0<-37131))jkk=37;//445 北魏<景初曆>年策=365.24689
   if(liza==1&&(n0>=-37131&&n0<-35427))jkk=38;//452 北魏<玄始曆>年策=365.2479
   if(liza==1&&(n0>=-35427&&n0<-34491))jkk=39;//523 北魏<正光曆>到562
   if(liza==1&&(n0>=-34491&&n0<-34395))jkk=40;//562 北魏<正光曆>到566
   if(liza==1&&(n0>=-34395&&n0<-33963))jkk=41;//566 北魏<天和曆,大象曆>到584
   if(liza==1&&(n0>=-33963&&n0<-33818))jkk=43;//584 隋<開皇曆>年策590
   if(liza==1&&(n0>=-25227&&n0<-24051))jkk=44;//948- 996遼
   if(liza==1&&(n0>=-24051&&n0<-23523))jkk=45;//997- 1018遼
   if(liza==1&&(n0>=-23955&&n0<-23931))jqka=0.02*(n0-(-23954));//1001遼修正
   if(liza==1&&(n0==-23278||n0==-22432))jqka=-0.2;//1029- 1102遼修正
   if(liza==1&&(n0==-22106||n0==-22042))jqka=0.35;//遼修正||n0==-21520
   if(liza==1&&(n0>=-8475&&n0<-7563))jkk=34;//1646南明<授時曆>
   if(liza==1&&n0>=-7563)jkk=-1;//平氣結束
   if(liza==2&&(n0>=-42290&&n0<-41642))jkk=3;//237 蜀漢<四分曆>年策=365.25000
   if(liza==2&&(n0>=-35139&&n0<-35019))jkk=39;//535 東魏<正光曆>到539年
   if(liza==2&&(n0>=-35019&&n0<-34779))jkk=6;//540 東魏-549年
   if(liza==2&&(n0>=-34779&&n0<-34107))jkk=42;//550 北齊<天保曆>到578年
  var yk0=ykche[jkk];//初數
  var jka=jkche[jkk];//氣長
  var jk9=jkche2[jkk];//節差數
  var yk3=jka*(n0-jk9);
  var jq=yk0+yk3-ykd+0.5;//古代史實平氣d0值
  vj=jq+jqka;
  if(liza==0&&y==502&&n==12)vj=1904585-ykd;if(liza==0&&y==559&&n==12)vj=1925404-ykd;if(liza==0&&y==575&&n==20)vj=1931368.952-ykd;
  if(liza==0&&y==697&&n==24)vj=1975991-ykd;if(liza==0&&y==698&&n==2)vj=1976020-ykd;if(liza==0&&y==725&&n==4)vj=1985913.001-ykd;
  if(jkk==-1)vj=vsa;
  }
  var vs=(pd)?vsa:vj;//vj為古代平氣,現代粗算定氣:(juD+yrD+shuoD-erD(y,1,0)-1721425),現代粗算平氣:(juD-erD(y,1,0)-1721425)
  return vs;
}
function jqi(y,m,d,a,b){
  var dpzi=' 定';var dbq='東8區';if(a==4)dpzi=' ',dbq=' ';
  var qSt5='';if(a==1)qSt5='定';if(a==2)qSt5='<img border="0" src="7000wnldat/jiqi.gif" width="12" height="12">';
  var Dmyh=D0(y,m,1);var Dmyi=D0(y,m+1,1);var Dmyk=D0(y,m,d);var sT1='';
  var mL=Dmyi-Dmyh;if(y==1582&&m==10)mL=31;var jqws=(2*m-1);//jqa=2*m-4;jqb=2*m+1;
  var jqwsr=(a==3||a==4)?floor((floor(S(y,jqws)-Dmyh)/14)):floor((floor(S(y,jqws,1)-Dmyh)/14));
  var jqwst=jqwsr;if(jqwsr<0)jqwst=jqwsr+1;
  var jqwsq=jqws-jqwst;
  var yr2=yearStr(y);
  for(var j=jqwsq;j<=jqwsq+2;j++){
  var sDt1=(a==3||a==4)?sDt1=S(y,j):S(y,j,1);
  var sDta1=floor(sDt1);
  var sD1=antiD0(y,floor(sDt1));
  var sM1=floor(sD1/100);
  sDate1=sD1%100;if(y==1582&&m==10)sDate1=sDate1+10;
  var sN1=rem(j-1,24)+1;
  if(a==0&&sDta1>=(Dmyh)&&sDta1<Dmyi)sT1+='公曆'+yr2+'<b>'+sM1+'月'+dsz(sDate1)+'日'+dbq+dToStr(tail(sDt1))+dpzi+sStr(sN1)+'</b><br>';
  if(a==4&&sDta1>=(Dmyh)&&sDta1<Dmyi)sT1+='公曆'+sM1+'月'+dsz(sDate1)+'日(農曆'+lunMStr(lunMon(y,sM1,sDate1),b)+'月'+dsz(floor(lunDate(y,sM1,sDate1)-floor(lunDate(y,sM1,sDate1)/100)*100))+'日)'+dToStr(tail(sDt1))+sStr(sN1)+'<br>';
  if(a==1&&sDta1==Dmyk)sT1+=qSt5+sStr(sN1)+':東8區'+dToStr(tail(sDt1));
  if((a==2||a==3)&&sDta1==Dmyk)sT1+=qSt5+sStr(sN1);
  }
  var sDtkk=sT1;
  return sDtkk;
  }
  function jqinl(y,m,d,luny,lunM,lunD,lunMe,mds,a,b){
  var dpzi='定';var dbq='東8區';if(a==4)dpzi=' ',dbq=' ';
  var qSt5='';if(a==1)qSt5='定';if(a==2)qSt5='<img border="0" src="7000wnldat/jiqi.gif" width="12" height="12">';
  var dmds=(mds=='大')?30:29;
  var Dmyh=D0(y,m,d)-lunD+1;var Dmyi=Dmyh+dmds*1;var Dmyk=D0(y,m,d);var sT1='';
  var mL=Dmyi-Dmyh;var jqws=(2*(rem(lunMe,12)+1)-1);
  var jqwsr=(a==3||a==4)?floor((floor(S(y,jqws)-Dmyh)/14)):floor((floor(S(y,jqws,1)-Dmyh)/14));
  var jqwst=jqwsr;if(jqwsr<0)jqwst=jqwsr+1;
  var jqwsq=jqws-jqwst;
  yda=D0(y,1,1);ydb=D0(y,12,31);
  for(var j=jqwsq;j<=jqwsq+3;j++){
  var sDt1=(a==3||a==4)?sDt1=S(y,j):S(y,j,1);
  var sDta1=floor(sDt1);var yyr=y;if(sDta1<yda)yyr=y-1;if(sDta1>ydb)yyr=y+1*1;
  var sD1=antiD0(y,floor(sDt1));
  var sM1=rem(floor(sD1/100)-1,12)+1;
  sDate1=sD1%100;if(y==1582&&sM1==10)sDate1=sDate1+10;
  var sN1=rem(j-1,24)+1;var yr2=yearStr(yyr);//yearStr(luny)+
  if(a==0&&sDta1>=(Dmyh)&&sDta1<Dmyi)sT1+='農曆'+yearStr(luny)+'<b>'+lunMStr(lunM,b)+'月'+lunDStr(floor(lunDate(yyr,sM1,sDate1)-floor(lunDate(yyr,sM1,sDate1)/100)*100))+''+dbq+dToStr(tail(sDt1))+dpzi+sStr(sN1)+'</b><br>';
  if(a==4&&sDta1>=(Dmyh)&&sDta1<Dmyi)sT1+='公曆'+sM1+'月'+dsz(sDate1)+'日(農曆'+lunMStr(lunMon(yyr,sM1,sDate1),b)+'月'+dsz(floor(lunDate(yyr,sM1,sDate1)-floor(lunDate(yyr,sM1,sDate1)/100)*100))+'日)'+dToStr(tail(sDt1))+sStr(sN1)+'<br>';
  }
  var sDtkk=sT1;
  return sDtkk;
  }
//--節氣實際顯示--//
 function jqi1(y,m,d){//顯示方式1,交節時間在某日、到了某日就顯示出交節時間
 return jqi(y,m,d,1);
 }
 function jqi2(y,m,d,luny,lunM,lunD,lunMe,mds,gonnl,b){//顯示方式2,公曆每月的節氣交節時間
 var jqxz=(gonnl==1)?jqinl(y,m,d,luny,lunM,lunD,lunMe,mds,0,b):jqi(y,m,d,0,b);
 return jqxz;//jqi(y,m,d,0);
 }
 function jqi5(y,m,d,luny,lunM,lunD,lunMe,mds,gonnl,b){//顯示方式4,用特效窗口顯示實曆二十四節氣
 var xz=(gonnl==1)?jqinl(y,m,d,luny,lunM,lunD,lunMe,mds,4,b):jqi(y,m,d,4,b);
 var xc='<b>實曆二十四節氣(平氣)</b><br>';if(y>=1647&&y<1961||y==1646&&m>=2)xc='<b>實曆二十四節氣</b><br>';
 if(y<-221||y==-221&&m<11)xc='<b>實曆二十四節氣</b><br>',xz='史上此年代還沒有完整的24節氣記載<br>請參考上面用現代數據反推的24節氣';
 if(y>=1961)xc='<b>二十四節氣</b><br>'
 var xs='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+xc+xz;
 return xs;
 }
 function jqi3(y,m,d){//節氣顯示方式3,用於月曆格子
  var sjq2='';var sjq0=jqi(y,m,d,2);
  if(sjq0>'')sjq2='<img border="0" src="7000wnldat/jiqi.gif" width="12" height="12">';
  var sjq1=jqi(y,m,d,3); var sjq=sjq2+sjq1;
 return sjq;
 }/////節氣計算結束

[此贴子已经被作者于2014-2-20 9:10:02编辑过]

支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  36楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:34:00

function siju(y,m,d,h,mi){///四季
 var mi=abs(mi);
 var djr=(D0(y,m,d)+(h+(mi+1)/60)/24);
 if(djr>=(y,3,1)&&djr<S(y,9,1))
   var gzM=0;
 if(djr>=S(y,9,1)&&djr<S(y,15,1))
   var gzM=1;
 if(djr>=S(y,15,1)&&djr<S(y,21,1))
   var gzM=2;
 if(djr>=S(y,21,1)||djr<S(y,3,1))
   var gzM=3;
 return gzM;
}
  function qisiehou(y1,m1,d1){//72物候
        var djt=D0(y1,m1,d1);var xs1='';
        var a=1;if(y1>=-220&&y1<1646||y1==1646&&m1==1&&d1<30)a='';
 if(djt>floor(S(y1,-2,a))+3 && djt<=floor(S(y1,-2,a))+8){xs1='天氣騰地氣降';}
 else if(djt>floor(S(y1,-2,a))+8 && djt<floor(S(y1,-1,a))-1){xs1='閉塞成冬';}
 else if(djt>=floor(S(y1,-1,a))-1 && djt<=floor(S(y1,-1,a))+3){xs1='鹖鴠不鳴';}
 else if(djt>floor(S(y1,-1,a))+3 && djt<=floor(S(y1,-1,a))+8){xs1='虎始交';}
 else if(djt>floor(S(y1,-1,a))+8 && djt<floor(S(y1,0,a))-1){xs1='荔挺出';}
 else if(djt>=floor(S(y1,0,a))-1 && djt<=floor(S(y1,0,a))+3){xs1='蚯蚓結';}
 else if(djt>floor(S(y1,0,a))+3 && djt<=floor(S(y1,0,a))+8){xs1='麋鹿解';}
 else if(djt>floor(S(y1,0,a))+8 && djt<floor(S(y1,1,a))-1){xs1='水泉動';}
 else if(djt>=floor(S(y1,1,a))-1 && djt<=floor(S(y1,1,a))+3) {xs1='雁北鄉';}
 else if(djt>floor(S(y1,1,a))+3 && djt<=floor(S(y1,1,a))+8) {xs1='鵲始巢';}
 else if(djt>floor(S(y1,1,a))+8 && djt<floor(S(y1,2,a))-1){xs1='鳺始鴝';}
 else if(djt>=floor(S(y1,2,a))-1 && djt<=floor(S(y1,2,a))+3){xs1='雞始乳';}
 else if(djt>floor(S(y1,2,a))+3 && djt<=floor(S(y1,2,a))+8){xs1='征鳥厲疾';}
 else if(djt>floor(S(y1,2,a))+8 && djt<floor(S(y1,3,a))-1){xs1='水澤腹堅';}
 else if(djt>=floor(S(y1,3,a))-1 && djt<=floor(S(y1,3,a))+3){xs1='東風解凍';}
 else if(djt>floor(S(y1,3,a))+3 && djt<=floor(S(y1,3,a))+8){xs1='蟄蟲始振';}
 else if(djt>floor(S(y1,3,a))+8 && djt<floor(S(y1,4,a))-1){xs1='魚上冰';}
 else if(djt>=floor(S(y1,4,a))-1 && djt<=floor(S(y1,4,a))+3){xs1='獺祭魚';}
 else if(djt>floor(S(y1,4,a))+3 && djt<=floor(S(y1,4,a))+8){xs1='候雁北';}
 else if(djt>floor(S(y1,4,a))+8 && djt<floor(S(y1,5,a))-1){xs1='草木萌動';}
 else if(djt>=floor(S(y1,5,a))-1 && djt<=floor(S(y1,5,a))+3){xs1='桃始華';}
 else if(djt>floor(S(y1,5,a))+3 && djt<=floor(S(y1,5,a))+8){xs1='倉庚鳴';}
 else if(djt>floor(S(y1,5,a))+8 && djt<floor(S(y1,6,a))-1){xs1='鷹化爲鳩';}
 else if(djt>=floor(S(y1,6,a))-1 && djt<=floor(S(y1,6,a))+3){xs1='玄鳥至';}
 else if(djt>floor(S(y1,6,a))+3 && djt<=floor(S(y1,6,a))+8){xs1='雷乃發聲';}
 else if(djt>floor(S(y1,6,a))+8 && djt<floor(S(y1,7,a))-1){xs1='始電';}
 else if(djt>=floor(S(y1,7,a))-1 && djt<=floor(S(y1,7,a))+3){xs1='桐始華';}
 else if(djt>floor(S(y1,7,a))+3 && djt<=floor(S(y1,7,a))+8){xs1='田鼠化爲鴽';}
 else if(djt>floor(S(y1,7,a))+8 && djt<floor(S(y1,8,a))-1){xs1='虹始見';}
 else if(djt>=floor(S(y1,8,a))-1 && djt<=floor(S(y1,8,a))+3){xs1='萍始生';}
 else if(djt>floor(S(y1,8,a))+3 && djt<=floor(S(y1,8,a))+8){xs1='鳴鳩拂其羽';}
 else if(djt>floor(S(y1,8,a))+8 && djt<floor(S(y1,9,a))-1){xs1='戴勝降於桑';}
 else if(djt>=floor(S(y1,9,a))-1 && djt<=floor(S(y1,9,a))+3){xs1='螻蟈鳴';}
 else if(djt>floor(S(y1,9,a))+3 && djt<=floor(S(y1,9,a))+8){xs1='蚯蚓出';}
 else if(djt>floor(S(y1,9,a))+8 && djt<floor(S(y1,10,a))-1){xs1='王瓜生';}
 else if(djt>=floor(S(y1,10,a))-1 && djt<=floor(S(y1,10,a))+3){xs1='苦菜秀';}
 else if(djt>floor(S(y1,10,a))+3 && djt<=floor(S(y1,10,a))+8){xs1='靡草死';}
 else if(djt>floor(S(y1,10,a))+8 && djt<floor(S(y1,11,a))-1){xs1='麥秋至';}
 else if(djt>=floor(S(y1,11,a))-1 && djt<=floor(S(y1,11,a))+3){xs1='螳螂生';}
 else if(djt>floor(S(y1,11,a))+3 && djt<=floor(S(y1,11,a))+8){xs1='鵙始鳴';}
 else if(djt>floor(S(y1,11,a))+8 && djt<floor(S(y1,12,a))-1){xs1='反舌無聲';}
 else if(djt>=floor(S(y1,12,a))-1 && djt<=floor(S(y1,12,a))+3){xs1='鹿角解';}
 else if(djt>floor(S(y1,12,a))+3 && djt<=floor(S(y1,12,a))+8){xs1='蜩始鳴';}
 else if(djt>floor(S(y1,12,a))+8 && djt<floor(S(y1,13,a))-1){xs1='半夏生';}
 else if(djt>=floor(S(y1,13,a))-1 && djt<=floor(S(y1,13,a))+3){xs1='溫風至';}
 else if(djt>floor(S(y1,13,a))+3 && djt<=floor(S(y1,13,a))+8){xs1='蟀蟋居壁';}
 else if(djt>floor(S(y1,13,a))+8 && djt<floor(S(y1,14,a))-1){xs1='鷹如鷙';}
 else if(djt>=floor(S(y1,14,a))-1 && djt<=floor(S(y1,14,a))+3){xs1='腐草爲螢';}
 else if(djt>floor(S(y1,14,a))+3 && djt<=floor(S(y1,14,a))+8){xs1='土潤溽暑';}
 else if(djt>floor(S(y1,14,a))+8 && djt<floor(S(y1,15,a))-1){xs1='大雨時行';}
 else if(djt>=floor(S(y1,15,a))-1 && djt<=floor(S(y1,15,a))+3){xs1='涼風至';}
 else if(djt>floor(S(y1,15,a))+3 && djt<=floor(S(y1,15,a))+8){xs1='白露降';}
 else if(djt>floor(S(y1,15,a))+8 && djt<floor(S(y1,16,a))-1){xs1='寒蟬鳴';}
 else if(djt>=floor(S(y1,16,a))-1 && djt<=floor(S(y1,16,a))+3){xs1='鷹乃祭鳥';}
 else if(djt>floor(S(y1,16,a))+3 && djt<=floor(S(y1,16,a))+8){xs1='天地始肅';}
 else if(djt>floor(S(y1,16,a))+8 && djt<floor(S(y1,17,a))-1){xs1='禾乃登';}
 else if(djt>=floor(S(y1,17,a))-1 && djt<=floor(S(y1,17,a))+3){xs1='鴻雁來';}
 else if(djt>floor(S(y1,17,a))+3 && djt<=floor(S(y1,17,a))+8){xs1='玄鳥歸';}
 else if(djt>floor(S(y1,17,a))+8 && djt<floor(S(y1,18,a))-1){xs1='群鳥養羞';}
 else if(djt>=floor(S(y1,18,a))-1 && djt<=floor(S(y1,18,a))+3){xs1='雷乃收聲';}
 else if(djt>floor(S(y1,18,a))+3 && djt<=floor(S(y1,18,a))+8){xs1='蟄蟲坯戶';}
 else if(djt>floor(S(y1,18,a))+8 && djt<floor(S(y1,19,a))-1){xs1='水始涸';}
 else if(djt>=floor(S(y1,19,a))-1 && djt<=floor(S(y1,19,a))+3){xs1='鴻雁來賓';}
 else if(djt>floor(S(y1,19,a))+3 && djt<=floor(S(y1,19,a))+8){xs1='雀入大水爲蛤';}
 else if(djt>floor(S(y1,19,a))+8 && djt<floor(S(y1,20,a))-1){xs1='菊有黃花';}
 else if(djt>=floor(S(y1,20,a))-1 && djt<=floor(S(y1,20,a))+3){xs1='豺乃祭獸';}
 else if(djt>floor(S(y1,20,a))+3 && djt<=floor(S(y1,20,a))+8){xs1='草木黃落';}
 else if(djt>floor(S(y1,20,a))+8 && djt<floor(S(y1,21,a))-1){xs1='蟄蟲鹹俯';}
 else if(djt>=floor(S(y1,21,a))-1 && djt<=floor(S(y1,21,a))+3){xs1='水始冰';}
 else if(djt>floor(S(y1,21,a))+3 && djt<=floor(S(y1,21,a))+8){xs1='地始凍';}
 else if(djt>floor(S(y1,21,a))+8 && djt<floor(S(y1,22,a))-1){xs1='雉入大水爲蜃';}
 else if(djt>=floor(S(y1,22,a))-1 && djt<=floor(S(y1,22,a))+3){xs1='虹藏不見';}
 else if(djt>floor(S(y1,22,a))+3 && djt<=floor(S(y1,22,a))+8){xs1='天氣騰地氣降';}
 else if(djt>floor(S(y1,22,a))+8 && djt<floor(S(y1,23,a))-1){xs1='閉塞成冬';}
 else if(djt>=floor(S(y1,23,a))-1 && djt<=floor(S(y1,23,a))+3){xs1='鹖鴠不鳴';}
 else if(djt>floor(S(y1,23,a))+3 && djt<=floor(S(y1,23,a))+8){xs1='虎始交';}
 else if(djt>floor(S(y1,23,a))+8 && djt<floor(S(y1,24,a))-1){xs1='荔挺出';}
 else if(djt>=floor(S(y1,24,a))-1 && djt<=floor(S(y1,24,a))+3){xs1='蚯蚓結';}
 else if(djt>floor(S(y1,24,a))+3 && djt<=floor(S(y1,24,a))+8){xs1='麋鹿解';}
 else if(djt>floor(S(y1,24,a))+8  && djt<floor(S(y1,25,a))-1){xs1='水泉動';}
 else if(djt>=floor(S(y1,25,a))-1 && djt<=floor(S(y1,25,a))+3) {xs1='雁北鄉';}
 else if(djt>floor(S(y1,25,a))+3) {xs1='鵲始巢';}
 return xs1;
 }

支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  37楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:34:00

//---------公曆--------//
function  mondas(y,m){
  var mL=D0(y,m+1,1)-D0(y,m,1);
  if(mL==31)  mDx1='大'; if(mL==30)  mDx1='小'; if(mL==29)  mDx1='閏';
  if(mL==28)  mDx1='平'; if(mL==21)  mDx1='大';
  return mDx1;
  }
//星期
function Day(y,m,d){
  return round(rem(erD(y,m,d),7));
}
//星座
function sZod(y,m,d){
var d0=D0(y,m,d);var xz=0;
    for(var i=-1;i<14;i++){
    var ii=i*2,iii=ii*1+2;
    if(d0>=floor(S(y,ii,1))&&d0<floor(S(y,iii,1)))
      xz=((i+12)%12);
    }
  return xz;
}

支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  38楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:35:00

 //-----農曆--//
//---日、月數及日月食---//
  var qdjd=new Array(//起點jd、史實平朔擬合1
  1457727.915958,1565455.530851,1683489.570910,1752148.041079,1807665.420323,1883618.114100,1907360.704700,1936596.224900,1939135.675300,1802556.7066010,
  1927825.660455,1932580.235910,1934410.960500);
  var kzca=new Array(//起點kzs值差、史實平朔擬合2
  32417,28769,24772,22447,20567,17995,17191,16201,16115,20740,16498,16337,16275
  );
  var yche=new Array(//月長、史實平朔擬合3
  29.530805106,29.530805,29.53086158,29.53085097,29.53059851,29.53060000,29.53060000,29.53060000,29.53060000,29.53054422,29.530655,29.530675,29.53060000
  );
  //史實定朔修正開始
  var suoS='2FpCaFlmsdErDfFiFipdiEpFfEcaipqf1ksQikpfkq2fkqtekqQgkotgkqtekstfkptikq2fjstgjqQjkqtekqtekstfkpfkq2fjstgjiFfFoCiADpDrsliCkCsAEe1cAF1EaEfgdfikikFffakbFhaikgFag1EaFkieeibuiffdeigFfqDfkciDsFtdF1kEaikhkigeiahabgcFfakF1ukiFeiaFiqEffckekidhhdhdikcikiafakF1dehdFhFccgbkdekgiFbiaikcfi1F1FibefjEgFdcFkFeFkdcfkF1kfkciaDfDacFiDgiaejcFfffkhkdgkFiei1ehdikedFffcjbdhhdikcfgjikhfjicjicgiehdikcikucifgiejF1jkieedikcikucikFegiegkfjefghigikucikdgkaFkijcfkcikfkcifikiukaeedefkckffcfkhkdgkedeidhijcFfakhfgehgieidiegikhfkfckfcjbdehdikcikgkfkicjicjF1dbidikFiucifgiejkikukigcdikcfucikdbgfjefjF1kfegikucikdgFkeeijcfkcikfkekcikdgkegbhkFikaffkefkhkdgkegbiae';
  suoS+='kffakiakhfgqdq2fkiakgkfkhfkfcjiekgFkgdkicgFiedF1jikejbbbicjbukacgiejkiLgigfiakufucibFifjefjF1kfekdgjcibFegcijcfkfhkfkeaieigekufhkfikiFkcjeaibgekgdkiffiffkiakF1jhbakgdki1dj1ikfkickfcjieedfgdkicukigeigF1jfgkgfgbgikicufukideeigjgijkeijfiskiukiaidhedF1jekijcikiukiukidhhdbgcfkFikfhkigeie1hiaikuikhkffaffijhidhhdikuikifikFikiakF1kfhedikuikifiukigicjiejkieedikuiffiukigieFijkfjkgkigbgikifiukiaideeijkefjeijikhkiukiaidheigcikaikaikijgkiahi1hhdiejcfaakekighhi1hiaikuikhkffakicjhiahaikuikhkikF1jF1jfeFhidikuiffiukigiejkikgkgieedikuiffiukidheigkgfjkeigikuikifiukiaiFieijcfkFikikhkiukiahi1ehigcikaffkhkiukiahi1hhdikekfiFkFikcidhh1hitcikuikhkikf';
  suoS+='cjicghiedikcikuikhkijbjfejkieFhaikuiffiukigiejkiLgikgeigikuiffiukigieeigekijcijikuiffiukideedeijkefkfckikhkiukhdhi1ehijcikaffkhkiukiahi1hhdikekikFikfckcidhh1hikcikuikhfjicjicgiehdikcikuifikigbjfejkieFhaikuifikiufghigkfjeijkhigikuifikiukigieeijcijcikfksikifikiukidehdeijcfdckikhkiukhdhi1ehijcfaffkhsEkErDoVtDd1AEtAFrCfEtoEpDqElB2DtEeEqEpBmADlF2AB2BtBmFsFsAD2llAFnBpBtVCmDlAFnlVbACoEqAEmAClB1EeD2ACrBsFtCtAFrAtFqFiCstAE1AFtDdA2BmFtAC2kACpFaowlFtABgmAl2bDsAD1FsVEbBtAFpArgEcBrACfAFoVDnVEfVFmEpAElVcC2VDsMBmBqBpVrFpACrFlAEqAC2wElVFsyFlxDaxmxBtFqBmC2NNxD1';//2018,10(17289-15819=1470)
  var soujz=jieya(suoS);
  var suoSliao='2ACsxCkAFtDmFqFqDmk1lADnVDmqADsAEpmsVeAC1FlDddVBkFkoCcgBmDbCkDdpVFkDgFlxBfACbaFaACeADcADiAaVFfFdgBbCkADcAgAEaDrAFiVBfACqpFfzFnVFtFtsftFlDqEprBkc1AEdD2Ds0';//K值從-12077到-7716
  var suoSlijz=jieya(suoSliao);//923年到1276年遼金蒙古(元);
  function soulija(k){
  var v=suoSlijz.charAt(k-(-12077));
  if(k==-3081||k==-3066||k==-3042||k==-2942||k==-2831)v=1;if(k==-3058||k==-3046||k==-2789||k==-2786)v=-1;//補南明實曆朔修日正
  if(v=='1')//-3081=1650.11//-3066=1652.1//-3058=1652.9//-3046=1653.8//-3042-1653.12//-2942=1662.1//-2831=1671.1//-2789=1674.6//-2786=1674.9
    v=1;
  if(v=='2')
    v=-1;
  if(v==''||v=='0')
    v=0;
  return parseInt(v);
  }
  function souj(k){//620年十二月k=0;
  var v2='';var v=soujz.charAt(k);//農曆的校正(620-1950)if(k==18710)v=0;
  if(v=='1')
    v2=1;
  if(v=='2')
    v2=-1;
  if(v==''||v=='0')
    v2=0;
  return parseInt(v2);
 }//史實定朔修正結束
  function rsys(y,m,d,saL){//月相如lunD=15.5235,15為日數,小數部分是朔弦望時刻(該天不朔,不弦或不望為零空)
  var zone=8;//時區
  var lunD=-1;//農曆日數
  var t=(y-1899.5)/100;
  var ms=floor((y-1900)*12.3685);
  var rpi=180/PI();
  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 jeJD=erJD(y,m,d);
  var mt=jeJD-1;var mw=jeJD+30;
  var mtk=((floor((mt-2451550.259)/29.530588))+1-(ms-1236));
  var mwk=((floor((mw-2451550.259)/29.530588))+1-(ms-1236));
  var leap=0;  //閏月,0不閏
  var ecli=''; //日月食
  var lunD=-1; //農曆日
  var shuoD=0; //朔日數
  var shuoT=0; //朔時刻
  var shanxD=0;//上弦時刻
  var shanxT=0;//上弦日數
  var wangD=0; //望時刻
  var wangT=0; //望日數
  var xiaxD=0; //下弦時刻
  var xiaxT=0; //下弦日數
  for(var k=mtk;k<=mwk;k+=0.25){//k=整數朔,k=半整數望
    var aa=aa0+0.507984293*k;var ab=ab0+6.73377553*k;var ac=ac0+6.818486628*k;
    if(k==floor(k)){
    var ksa=(ms+floor(k));//朔月值1900年1月1號哪次朔ksa=0
    var ksb=ksa-1237;var kak=0;//if(ksa==1951||ksa==2444)kak=1;整合高精度朔用的朔月值2000年1月7號哪次朔ksb=0
    var soj=(so_high(ksb)+(kak));//朔或望的等效儒略日
    var lunDsa=(jeJD-floor(soj));//當日距朔日的差
    if(k==floor(k)&&lunDsa>=0&&lunDsa<=29){
    var k1=floor(k);//當前的k值
   lunD=lunDsa+1;
   }}
   if(saL>''&&(k==k1||k==(k1+0.25)||k==(k1+0.5)||k==(k1+0.75))){
    var f1=f0+1.53058868*k+fc*sin(aa)-0.4068*sin(ab)+0.0021*sin(2*aa)+0.0161*sin(2*ab)+0.0104*sin(2*ac)-0.0074*sin(aa-ab)-0.0051*sin(aa+ab);
    var j=j0+28*k+f1+1721425;
    if(k==k1&&lunD==1){
    shuoT=(kak==0)?tail(suoCalc(ksb,0)):'0.0001';
    }
    if(k==(k1+0.25)&&abs((jeJD-floor(j)))<2){
    var shanxDs=suoCalc(ksb,90);shanxT=tail(shanxDs);
    shanxD=floor(shanxDs)-(jeJD-lunD+1)+1;
    }
    if(k==(k1+0.5)&&abs((jeJD-floor(j)))<2){
    var wangDs=suoCalc(ksb,180);wangT=tail(wangDs);
    wangD=floor(wangDs)-(jeJD-lunD+1)+1;
    }
    if(k==(k1+0.75)&&abs((jeJD-floor(j)))<2){
    var xiaxDs=suoCalc(ksb,270);xiaxT=tail(xiaxDs);
   xiaxD=floor(xiaxDs)-(jeJD-lunD+1)+1;
   }//判斷日月食
  if((lunD==1&&k==k1)||(lunD==wangD&&k==(k1+0.5))){
  if(abs(sin(ac))<=0.36){
  var s=5.19595-0.0048*cos(aa)+0.002*cos(2*aa)-0.3283*cos(ab)-0.006*cos(aa+ab)+0.0041*cos(aa-ab);
  var r=0.207*sin(aa)+0.0024*sin(2*aa)-0.039*sin(ab)+0.0115*sin(2*ab)-0.0073*sin(aa+ab)-0.0067*sin(aa-ab)+0.0117*sin(2*ac);
  var p=abs(s*sin(ac)+r*cos(ac));
  var q=0.0059+0.0046*cos(aa)-0.0182*cos(ab)+0.0004*cos(2*ab)-0.0005*cos(aa+ab);
  if(p-q<=1.5572){
  ecli='(日食)';//日食
  if(k!=floor(k)){//月食
  if(p+q>=1.0129)
  ecli='(月偏食)';
  else
  ecli='(月全食)';
  }}}}}else{}}//k循環結束
 if(y==1924&&m==3&&d==5)ecli='(日食)';//日食修正2415021
  var str='';
  var v1=lunD;
  if(saL==1){
  if(v1==1||v1==101||v1==201)//日曆部份
  str='東8區'+dToStr(shuoT)+'朔<img border="0" src="7000wnldat/so.gif" width="11" height="11">'+ecli;
  else
  if(v1==shanxD)
  str='東8區'+dToStr(shanxT)+'上弦<img border="0" src="7000wnldat/shanx.gif" width="11" height="11">';
  else
  if(v1==wangD)
  str='東8區'+dToStr(wangT)+'望<img border="0" src="7000wnldat/wan.gif" width="11" height="11">'+ecli;
  else
  if(v1==xiaxD)
  str='東8區'+dToStr(xiaxT)+'下弦<img border="0" src="7000wnldat/xiax.gif" width="11" height="11">';
  else;
  }else{ if(saL==2){
  if(v1==1||v1==101||v1==201)//月曆部份
  str='<img border="0" src="7000wnldat/so.gif" width="11" height="11">';
  else
  if(v1==shanxD)
  str='<img border="0" src="7000wnldat/shanx.gif" width="11" height="11">';
  else
  if(v1==wangD)
  str='<img border="0" src="7000wnldat/wan.gif" width="11" height="11">';
  else
  if(v1==xiaxD)
  str='<img border="0" src="7000wnldat/xiax.gif" width="11" height="11">';
  else;
   }else{str='';}}
  return str;
   }
  function lunData(JDe,saL){//日數、如3001,30表示月大(月小29),01表示日數。JDe等效儒略日,開關saL=5返回的是等效總月數1900年正月=1
  var zone=8;//時區
  var lunD=-1;//農曆日數
  var jeJD=JDe;//等效儒略日
  var jeaJD=2415021;//1900,1,1等效儒略日
  var yey=floor((jeJD-jeaJD)/365.25+1900);if(jeJD>=2299239)yey=floor((jeJD+10-jeaJD)/365.2425+1900);
  var y=yey;if(jeJD<erJD(yey,1,1))y=yey-1;if(jeJD>=erJD(yey+1,1,1))y=yey+1;
  var ms=floor((y-1900)*12.3685);var k1='';
  var mt=jeJD-1;var mw=jeJD+35;
  var mtk=((floor((mt-2451550.259)/29.530588))+1-(ms-1236));
  var mwk=((floor((mw-2451550.259)/29.530588))+1-(ms-1236));
  //(y<-849||y>=2111)(y>=2111)
  var rpi=(y>=1970)?0:180/PI();
  var t=(y>=1970)?0:(y-1899.5)/100;
  var f0=(y>=1970)?0: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=(y>=1970)?0:0.1734-3.93e-4*t;
  var j0=(y>=1970)?0:693595+29*ms;
  var aa0=(y>=1970)?0:ang(ms,t,0.08084821133,359.2242/rpi,0.0000333/rpi,0.00000347/rpi);
  var ab0=(y>=1970)?0:ang(ms,t,7.171366127999999e-2,306.0253/rpi,-0.0107306/rpi,-0.00001236/rpi);
  var ac0=(y>=1970)?0:ang(ms,t,0.08519585128,21.2964/rpi,0.0016528/rpi,0.00000239/rpi);
  for(var k=mtk-1;k<=mwk;k+=1){//朔k=整數(y>=-849&&y<1970)
  var kzs=ms+floor(k);//朔月值1900年1月1號哪次朔kzs=0
  if(y>=-849&&y<1970){
  var aa=(y>=1970)?0:aa0+0.507984293*k;var ab=ab0+6.73377553*k;var ac=ac0+6.818486628*k; 
  var f1=(y>=1970)?0:f0+1.53058868*k+fc*sin(aa)-0.4068*sin(ab)+0.0021*sin(2*aa)+0.0161*sin(2*ab)+0.0104*sin(2*ac)-0.0074*sin(aa-ab)-0.0051*sin(aa+ab);
  var qdkg=-1;var szi=0;if(kzs==-20469&&liza==1)szi=1;if(kzs==-20435&&liza==1)szi=-1;//三國時-吳國修正
  if(kzs==-17959&&liza==1)szi=1;if(kzs==-17868&&liza==1)szi=-1;if(kzs==-17018&&liza==1)szi=1;if(kzs==-16969&&liza==1)szi=1;if(kzs==-16920&&liza==1)szi=1;
  if(kzs==-16871&&liza==1)szi=1;if(kzs==-16822&&liza==1)szi=1;if(kzs==-16773&&liza==1)szi=1;if(kzs==-16724&&liza==1)szi=1;if(kzs==-16675&&liza==1)szi=1;
  if(kzs==-16626&&liza==1)szi=1;if(kzs==-16577&&liza==1)szi=1;if(kzs==-16528&&liza==1)szi=1;//447//563北魏,西魏,北周
  if(kzs==-16871&&liza==2)szi=1;if(kzs==-16822&&liza==2)szi=1;if(kzs==-16773&&liza==2)szi=1;if(kzs==-16724&&liza==2)szi=1;//535//東魏,北齊547/577北齊亡
  if(kzs>=-34000)qdkg=0;//前850年-1-21(JD=1410981)用;-722-1-16起、古曆·春秋戰國
  if(kzs>=-28769)qdkg=1;//前428年-12-26(JD=1565456)起用、古曆·春秋戰國·秦漢
  if(kzs>=-24771)qdkg=2;//前104年-03-23(JD=1683518)用;前104年-02-22起、漢書·(太初曆)
  if(kzs>=-22447)qdkg=3;//85年-02-13(JD=1752148)起、後漢書·(四分曆)
  if(kzs>=-20563)qdkg=4;//237年-06-11(JD=1807784)起用;237年-02-12起、晉書·律曆誌(景初曆)
  if(kzs>=-17995)qdkg=5;//445年-01-24(JD=1883619)起、宋書·(何承天元嘉曆)
  if(kzs>=-17191)qdkg=6;//510年-01-26(JD=1907361)起、宋書·(祖沖之大明曆)
  if(liza==2&&(kzs>=-20563&&kzs<-20233))qdkg=3;//蜀漢·(四分曆)接“漢”—264年2,15終
  if(liza==1&&(kzs>=-20740&&kzs<-20023))qdkg=9;//223年-02-18起、吳·乾象曆—281-02-06終
  if(liza==1&&(kzs>=-16498&&kzs<-16337))qdkg=10;//566年-02-06(JD=1927826)起、北周·(天和曆)
  if(liza==1&&(kzs>=-16337&&kzs<-16275))qdkg=11;//579年-02-12(JD=1932580)起、北周-隋·(大象曆)
  if(liza==1&&(kzs>=-16275&&kzs<-16201))qdkg=12;//584年-02-17(JD=1934411)起、隋·(開皇曆)
  if(kzs>=-16201)qdkg=7;//590年-02-10(JD=1936597)起、隋·(開皇曆)
  if(kzs>=-16115)qdkg=8;//597年-01-24(JD=1939136)起、隋·(大業曆)
  if(kzs>=-15843)qdkg=-1;//619-01-21(JD=1947168)平朔止
  var jsf=(kzs>=-34000&&kzs<-28769)?(0.00269249*(y-(-721))):0;
  var qdjds=(qdkg==-1)?'':(qdjd[qdkg]);//起點jd
  var yches=(qdkg==-1)?'':(yche[qdkg]);//起點kzs值差
  var qdkzs=(qdkg==-1)?'':(kzs+(kzca[qdkg]));//月長
  var liaok=(qdkg==-1&&liza==1)?soulija(kzs):0;//遼金蒙古(元)、南明
  var j=(qdkg==-1)?(j0+28*k+f1+1721425):((qdjds-jsf+yches*(qdkzs))+0.5)+szi;//朔等效儒略日及時刻
  var kk=(qdkg==-1)?(souj(ms+floor(k)+15819)):0;
  var lunD0=(qdkg==-1)?(jeJD-(floor(j)+kk+liaok)):(jeJD-(floor(j)));//當日距朔日的差
  }else{
  var ksb=kzs-1237;var kak=0;//if(kzs==1951||kzs==2444)kak=1;整合高精度朔用的朔月值2000年1月7號哪次朔ksb=0
  var j=(so_high(ksb)+(kak));var lunD0=(jeJD-(floor(j)));
  }
  if(k==floor(k)&&lunD0>=0&&lunD0<=29){
  lunD=(saL==5)?kzs:lunD0+1;k1=floor(k);
  var k8=kzs;
  var lunD03=(qdkg==-1)?(floor(j)+kk+liaok):(floor(j));if(saL==5)lunD03=0;//當月朔日的值
  }
  if(k==(k1+1)){
  var lunD02=(qdkg==-1)?(floor(j)+kk+liaok):(floor(j));if(saL==5)lunD02=0;//下月朔日的值
  }}
  var syd023=(saL==5)?0:lunD02-lunD03;//當月總天數;算大小月
  var v=lunD;//返回值
  var syd026=syd023;
 return(v+syd026*100);
 }


[此贴子已经被作者于2014-2-20 9:12:51编辑过]


支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  39楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:35:00

  function lunDatb(y,Mon,ms){//農曆月首日等效儒略日,y年Mon總月數,1900年正月Mon=1,ms為每年參考點(1900年整年ms=0,每年加12.3685)
  var zone=8;//時區
  var lunD=-1;//農曆日數
  var mtk=Mon-ms;
  //(y<-849||y>=2111)(y>=2111)
  var rpi=(y>=1970)?0:180/PI();
  var t=(y>=1970)?0:(y-1899.5)/100;
  var f0=(y>=1970)?0: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=(y>=1970)?0:0.1734-3.93e-4*t;
  var j0=(y>=1970)?0:693595+29*ms;
  var aa0=(y>=1970)?0:ang(ms,t,0.08084821133,359.2242/rpi,0.0000333/rpi,0.00000347/rpi);
  var ab0=(y>=1970)?0:ang(ms,t,7.171366127999999e-2,306.0253/rpi,-0.0107306/rpi,-0.00001236/rpi);
  var ac0=(y>=1970)?0:ang(ms,t,0.08519585128,21.2964/rpi,0.0016528/rpi,0.00000239/rpi);
  var k=mtk;//朔k=整數(y>=-849&&y<1970)
  var kzs=ms+floor(k);//朔月值1900年1月1號哪次朔kzs=0
  if(y>=-849&&y<1970){
  var aa=(y>=1970)?0:aa0+0.507984293*k;var ab=ab0+6.73377553*k;var ac=ac0+6.818486628*k; 
  var f1=(y>=1970)?0:f0+1.53058868*k+fc*sin(aa)-0.4068*sin(ab)+0.0021*sin(2*aa)+0.0161*sin(2*ab)+0.0104*sin(2*ac)-0.0074*sin(aa-ab)-0.0051*sin(aa+ab);
  var qdkg=-1;var szi=0;if(kzs==-20469&&liza==1)szi=1;if(kzs==-20435&&liza==1)szi=-1;//三國時-吳國修正
  if(kzs==-17959&&liza==1)szi=1;if(kzs==-17868&&liza==1)szi=-1;if(kzs==-17018&&liza==1)szi=1;if(kzs==-16969&&liza==1)szi=1;if(kzs==-16920&&liza==1)szi=1;
  if(kzs==-16871&&liza==1)szi=1;if(kzs==-16822&&liza==1)szi=1;if(kzs==-16773&&liza==1)szi=1;if(kzs==-16724&&liza==1)szi=1;if(kzs==-16675&&liza==1)szi=1;
  if(kzs==-16626&&liza==1)szi=1;if(kzs==-16577&&liza==1)szi=1;if(kzs==-16528&&liza==1)szi=1;//447//563北魏,西魏,北周
  if(kzs==-16871&&liza==2)szi=1;if(kzs==-16822&&liza==2)szi=1;if(kzs==-16773&&liza==2)szi=1;if(kzs==-16724&&liza==2)szi=1;//535//東魏,北齊547/577北齊亡
  if(kzs>=-34000)qdkg=0;//前850年-1-21(JD=1410981)用;-722-1-16起、古曆·春秋戰國
  if(kzs>=-28769)qdkg=1;//前428年-12-26(JD=1565456)起用、古曆·春秋戰國·秦漢
  if(kzs>=-24771)qdkg=2;//前104年-03-23(JD=1683518)用;前104年-02-22起、漢書·(太初曆)
  if(kzs>=-22447)qdkg=3;//85年-02-13(JD=1752148)起、後漢書·(四分曆)
  if(kzs>=-20563)qdkg=4;//237年-06-11(JD=1807784)起用;237年-02-12起、晉書·律曆誌(景初曆)
  if(kzs>=-17995)qdkg=5;//445年-01-24(JD=1883619)起、宋書·(何承天元嘉曆)
  if(kzs>=-17191)qdkg=6;//510年-01-26(JD=1907361)起、宋書·(祖沖之大明曆)
  if(liza==2&&(kzs>=-20563&&kzs<-20233))qdkg=3;//蜀漢·(四分曆)接“漢”—264年2,15終
  if(liza==1&&(kzs>=-20740&&kzs<-20023))qdkg=9;//223年-02-18起、吳·乾象曆—281-02-06終
  if(liza==1&&(kzs>=-16498&&kzs<-16337))qdkg=10;//566年-02-06(JD=1927826)起、北周·(天和曆)
  if(liza==1&&(kzs>=-16337&&kzs<-16275))qdkg=11;//579年-02-12(JD=1932580)起、北周-隋·(大象曆)
  if(liza==1&&(kzs>=-16275&&kzs<-16201))qdkg=12;//584年-02-17(JD=1934411)起、隋·(開皇曆)
  if(kzs>=-16201)qdkg=7;//590年-02-10(JD=1936597)起、隋·(開皇曆)
  if(kzs>=-16115)qdkg=8;//597年-01-24(JD=1939136)起、隋·(大業曆)
  if(kzs>=-15843)qdkg=-1;//619-01-21(JD=1947168)平朔止
  var jsf=(kzs>=-34000&&kzs<-28769)?(0.00269249*(y-(-721))):0;
  var qdjds=(qdkg==-1)?'':(qdjd[qdkg]);//起點jd
  var yches=(qdkg==-1)?'':(yche[qdkg]);//起點kzs值差
  var qdkzs=(qdkg==-1)?'':(kzs+(kzca[qdkg]));//月長
  var liaok=(qdkg==-1&&liza==1)?soulija(kzs):0;//遼金蒙古(元)、南明
  var j=(qdkg==-1)?(j0+28*k+f1+1721425):((qdjds-jsf+yches*(qdkzs))+0.5)+szi;//朔等效儒略日及時刻
  var kk=(qdkg==-1)?(souj(ms+floor(k)+15819)):0;
  var lunD0=(qdkg==-1)?((floor(j)+kk+liaok)):((floor(j)));//當日距朔日的差
  }else{
  var ksb=kzs-1237;var kak=0;//if(kzs==1951||kzs==2444)kak=1;整合高精度朔用的朔月值2000年1月7號哪次朔ksb=0
  var j=(so_high(ksb)+(kak));var lunD0=((floor(j)));
  }
  lunD=lunD0+1;k1=floor(k);
  var k8=kzs;
  var lunD03=(qdkg==-1)?(floor(j)+kk+liaok):(floor(j));//當月朔日的值
  var v=lunD03;//返回值
 return(v);
 }


[此贴子已经被作者于2014-2-20 9:14:39编辑过]


支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
chwc
  40楼 个性首页 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:603 积分:5315 威望:0 精华:4 注册:2008/4/21 19:06:00
  发帖心情 Post By:2014/2/19 13:36:00

  //---閏月信息---//
  //---前1188年到1988年某年的總閏月----//
var leapNumber=new Array(0,0,0,1,1,1,2,2,3,3,3,4,4,4,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,14,15,15,15,16,16,17,17,17,18,18,18,19,19,20,20,20,21,21,21,22,22,22,23,23,24,24,24,25,25,25,26,26,27,27,27,28,28,28,29,29,29,30,30,31,31,31,32,32,32,33,33,34,34,34,35,35,35,36,36,36,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,43,44,44,45,45,45,46,46,46,47,47,48,48,48,49,49,49,50,50,50,51,51,52,52,52,53,53,53,54,54,55,55,55,56,56,56,57,57,57,58,58,59,59,59,60,60,60,61,61,62,62,62,63,63,63,64,64,64,65,65,66,66,66,67,67,67,68,68,69,69,69,70,70,70,71,71,71,72,72,73,73,73,74,74,74,75,75,76,76,76,77,77,77,78,78,78,79,79,80,80,80,81,81,81,82,82,83,83,83,84,84,84,85,85,85,86,86,87,87,87,88,88,88,89,89,90,90,90,91,91,91,92,92,92,93,93,94,94,94,95,95,95,96,96,97,97,97,98,98,98,99,99,99,100,100,101,101,101,102,102,102,103,103,104,104,104,105,105,105,106,106,106,107,107,108,108,108,109,109,109,110,110,111,111,111,112,112,112,113,113,113,114,114,115,115,115,116,116,116,117,117,118,118,118,119,119,119,120,120,120,121,121,122,122,122,123,123,123,124,124,125,125,125,126,126,126,127,127,127,128,128,129,129,129,130,130,130,131,131,132,132,132,133,133,133,134,134,134,135,135,136,136,136,137,137,137,138,138,139,139,139,140,140,140,141,141,141,142,142,143,143,143,144,144,144,145,145,146,146,146,147,147,147,148,148,148,149,149,150,150,150,151,151,151,152,152,153,153,153,154,154,154,155,155,155,156,156,157,157,157,158,158,158,159,159,160,160,160,161,161,161,162,162,162,163,163,164,164,164,165,165,165,166,166,167,167,167,168,168,168,169,169,170,170,170,171,171,171,172,172,172,173,173,174,174,174,175,175,176,176,176,177,177,177,178,178,178,179,179,180,180,180,180,181,181,181,182,182,183,183,183,183,184,184,185,185,186,186,187,187,188,188,188,188,189,189,189,189,190,190,190,191,191,192,192,193,193,193,193,194,195,195,195,195,195,195,196,196,197,197,198,198,198,199,199,199,199,200,200,201,201,201,201,202,203,203,203,203,203,204,204,204,205,206,206,206,207,207,208,208,208,209,209,209,210,210,210,210,211,211,211,211,212,212,213,213,214,214,215,215,215,216,216,217,217,218,218,218,218,219,219,220,220,220,220,221,221,222,222,222,223,223,224,224,224,225,225,225,226,226,226,227,227,228,228,228,229,229,229,230,230,230,231,231,231,232,232,233,233,233,234,234,235,235,235,236,236,236,237,237,238,238,238,239,239,240,240,240,241,241,241,241,242,242,243,243,243,244,244,245,245,245,246,246,246,247,247,248,248,248,248,249,249,250,250,250,250,251,251,252,252,253,253,254,254,254,254,255,255,256,256,256,257,257,257,258,258,259,259,259,260,260,260,261,261,261,262,262,263,263,263,264,264,265,265,265,266,266,266,267,267,267,268,268,268,269,269,270,270,270,271,271,271,272,272,273,273,273,274,274,274,275,275,275,276,276,277,277,277,278,278,278,279,279,280,280,280,281,281,281,282,282,282,283,283,284,284,284,285,285,285,286,286,287,287,287,288,288,288,289,289,289,290,290,291,291,291,292,292,292,293,293,294,294,294,295,295,295,296,296,296,297,297,298,298,298,299,299,299,300,300,301,301,301,302,302,302,303,303,303,304,304,305,305,305,306,306,306,307,307,308,308,308,309,309,309,310,310,310,311,311,312,312,312,313,313,313,314,314,315,315,315,316,316,316,317,317,317,318,318,319,319,319,320,320,320,321,321,322,322,322,323,323,323,324,324,324,325,325,326,326,326,327,327,327,328,328,329,329,329,330,330,330,331,331,331,332,332,333,333,333,334,334,334,335,335,336,336,336,337,337,337,338,338,338,338,338,339,339,339,340,340,341,341,341,342,342,342,343,343,343,344,344,345,345,345,346,346,346,347,347,347,348,348,349,349,349,350,350,350,351,351,352,352,352,353,353,353,354,354,354,355,355,356,356,356,357,357,357,358,358,359,359,359,360,360,360,361,361,361,362,362,363,363,363,364,364,364,365,365,366,366,366,367,367,367,368,368,368,369,369,370,370,370,371,371,371,372,372,373,373,373,374,374,374,375,375,376,376,376,377,377,377,378,378,378,379,379,380,380,380,381,381,381,382,382,383,383,383,384,384,384,385,385,385,386,386,387,387,387,388,388,388,389,389,390,390,390,391,391,391,392,392,392,393,393,394,394,394,395,395,395,396,396,397,397,397,398,398,398,399,399,400,400,400,401,401,401,402,402,402,403,403,404,404,404,405,405,405,406,406,407,407,407,408,408,408,409,409,409,410,410,411,411,411,412,412,412,413,413,414,414,414,415,415,415,416,416,416,417,417,418,418,418,419,419,419,420,420,421,421,421,422,422,422,423,423,423,424,424,425,425,425,426,426,426,427,427,428,428,428,429,429,429,430,430,430,431,431,432,432,432,433,433,433,434,434,435,435,435,436,436,436,437,437,437,438,438,439,439,439,440,440,440,441,441,441,442,442,443,443,443,444,444,444,445,445,446,446,446,447,447,447,448,448,449,449,449,450,450,450,451,451,451,452,452,453,453,453,454,454,454,455,455,456,456,456,457,457,457,458,458,458,459,459,460,460,460,461,461,461,462,462,463,463,463,464,464,464,465,465,465,466,466,467,467,467,468,468,468,469,469,470,470,470,471,471,471,472,472,472,473,473,474,474,474,475,475,475,476,476,477,477,477,478,478,478,479,479,479,480,480,481,481,481,482,482,482,483,483,484,484,484,485,485,485,486,486,486,487,487,488,488,488,489,489,489,490,490,491,491,491,492,492,492,493,493,493,494,494,495,495,495,496,496,496,497,497,498,498,498,499,499,499,500,500,500,501,501,502,502,502,503,503,503,504,504,505,505,505,506,506,506,507,507,507,508,508,509,509,509,510,510,510,511,511,512,512,512,513,513,513,514,514,514,515,515,516,516,516,517,517,517,518,518,519,519,519,520,520,520,521,521,521,522,522,523,523,523,524,524,524,525,525,526,526,526,527,527,527,528,528,528,529,529,530,530,530,531,531,531,532,532,533,533,533,534,534,534,535,535,535,536,536,537,537,537,538,538,538,539,539,540,540,540,541,541,541,542,542,542,543,543,544,544,544,545,545,545,546,546,547,547,547,548,548,548,549,549,549,550,550,551,551,551,552,552,552,553,553,554,554,554,555,555,555,556,556,556,557,557,558,558,558,559,559,559,560,560,561,561,561,562,562,562,563,563,563,564,564,565,565,565,566,566,566,567,567,568,568,568,569,569,569,570,570,570,571,571,572,572,572,573,573,573,574,574,575,575,575,576,576,576,577,577,577,578,578,579,579,579,580,580,580,581,581,582,582,582,583,583,583,584,584,584,585,585,586,586,586,587,587,587,588,588,589,589,589,590,590,590,591,591,591,592,592,593,593,593,594,594,594,595,595,596,596,596,597,597,597,598,598,598,599,599,599,600,600,601,601,601,602,602,602,603,603,604,604,604,605,605,605,606,606,606,607,607,608,608,608,609,609,609,610,610,611,611,611,612,612,612,613,613,613,614,614,615,615,615,616,616,616,617,617,618,618,618,619,619,619,620,620,620,621,621,622,622,622,623,623,623,624,624,625,625,625,626,626,626,627,627,627,628,628,629,629,629,630,630,630,631,631,632,632,632,633,633,633,634,634,634,635,635,636,636,636,637,637,637,638,638,639,639,639,640,640,640,641,641,641,642,642,643,643,643,644,644,644,645,645,646,646,646,647,647,647,648,648,648,649,649,650,650,650,651,651,651,652,652,653,653,653,654,654,654,655,655,655,656,656,657,657,657,658,658,658,659,659,660,660,660,661,661,661,662,662,662,663,663,664,664,664,665,665,665,666,666,667,667,667,668,668,668,669,669,669,670,670,671,671,671,672,672,672,673,673,674,674,674,675,675,675,676,676,676,677,677,678,678,678,679,679,679,680,680,681,681,681,682,682,682,683,683,683,684,684,685,685,685,686,686,686,687,687,687,688,688,689,689,689,690,690,690,691,691,692,692,692,693,693,693,694,694,694,695,695,696,696,696,697,697,697,698,698,699,699,699,700,700,700,701,701,702,702,702,703,703,703,704,704,704,705,705,706,706,706,707,707,707,708,708,708,709,709,710,710,710,711,711,711,712,712,713,713,713,714,714,714,715,715,715,716,716,717,717,717,718,718,718,719,719,720,720,720,721,721,721,722,722,722,723,723,724,724,724,725,725,725,726,726,727,727,727,728,728,728,729,729,729,730,730,731,731,731,732,732,732,733,733,734,734,734,735,735,735,736,736,736,737,737,738,738,738,739,739,739,740,740,741,741,741,742,742,742,743,743,743,744,744,745,745,745,746,746,746,747,747,748,748,748,749,749,749,750,750,750,751,751,752,752,752,753,753,753,754,754,755,755,755,756,756,756,757,757,757,758,758,759,759,759,760,760,760,761,761,762,762,762,763,763,763,764,764,764,765,765,766,766,766,767,767,767,768,768,769,769,769,770,770,770,771,771,771,772,772,773,773,773,774,774,774,775,775,776,776,776,777,777,777,778,778,778,779,779,780,780,780,781,781,781,782,782,783,783,783,784,784,784,785,785,785,786,786,787,787,787,788,788,788,789,789,790,790,790,791,791,791,792,792,792,793,793,794,794,794,795,795,795,796,796,797,797,797,798,798,798,799,799,799,800,800,801,801,801,802,802,802,803,803,804,804,804,805,805,805,806,806,806,807,807,808,808,808,809,809,809,810,810,811,811,811,812,812,812,813,813,813,814,814,815,815,815,816,816,816,817,817,818,818,818,819,819,819,820,820,820,821,821,822,822,822,823,823,823,824,824,825,825,825,826,826,826,827,827,827,828,828,829,829,829,830,830,830,831,831,831,832,832,833,833,833,834,834,834,835,835,836,836,836,837,837,837,838,838,838,839,839,840,840,840,841,841,841,842,842,843,843,843,844,844,844,845,845,845,846,846,847,847,847,848,848,848,849,849,850,850,850,851,851,851,852,852,852,853,853,854,854,854,855,855,855,856,856,857,857,857,858,858,858,859,859,860,860,860,861,861,861,862,862,862,863,863,864,864,864,865,865,865,866,866,866,867,867,868,868,868,869,869,869,870,870,871,871,871,872,872,872,873,873,873,874,874,875,875,875,876,876,876,877,877,878,878,878,879,879,879,880,880,880,881,881,882,882,882,883,883,883,884,884,885,885,885,886,886,886,887,887,887,888,888,889,889,889,890,890,890,891,891,892,892,892,893,893,893,894,894,894,895,895,896,896,896,897,897,897,898,898,899,899,899,900,900,900,901,901,901,902,902,903,903,903,904,904,904,905,905,906,906,906,907,907,907,908,908,908,909,909,910,910,910,911,911,911,912,912,913,913,913,914,914,914,915,915,915,916,916,917,917,917,918,918,918,919,919,919,920,920,921,921,921,922,922,922,923,923,924,924,924,925,925,925,926,926,927,927,927,928,928,928,929,929,929,930,930,931,931,931,932,932,932,933,933,933,934,934,935,935,935,936,936,936,937,937,938,938,938,939,939,939,940,940,941,941,941,942,942,942,943,943,943,944,944,945,945,945,946,946,946,947,947,948,948,948,949,949,949,950,950,950,951,951,952,952,952,953,953,953,954,954,955,955,955,956,956,956,957,957,957,958,958,959,959,959,960,960,960,961,961,962,962,962,963,963,963,964,964,964,965,965,966,966,966,967,967,967,968,968,968,969,969,970,970,970,971,971,971,972,972,973,973,973,974,974,974,975,975,975,976,976,977,977,977,978,978,978,979,979,980,980,980,981,981,981,982,982,982,983,983,984,984,984,985,985,985,986,986,987,987,987,988,988,988,989,989,989,990,990,991,991,991,992,992,992,993,993,994,994,994,995,995,995,996,996,997,997,997,998,998,998,999,999,999,1000,1000,1001,1001,1001,1002,1002,1002,1003,1003,1003,1004,1004,1005,1005,1005,1006,1006,1006,1007,1007,1008,1008,1008,1009,1009,1009,1010,1010,1010,1011,1011,1012,1012,1012,1013,1013,1013,1014,1014,1015,1015,1015,1016,1016,1016,1017,1017,1017,1018,1018,1019,1019,1019,1020,1020,1020,1021,1021,1022,1022,1022,1023,1023,1023,1024,1024,1024,1025,1025,1026,1026,1026,1027,1027,1027,1028,1028,1029,1029,1029,1030,1030,1030,1031,1031,1031,1032,1032,1033,1033,1033,1034,1034,1034,1035,1035,1036,1036,1036,1037,1037,1037,1038,1038,1038,1039,1039,1040,1040,1040,1041,1041,1041,1042,1042,1042,1043,1043,1044,1044,1044,1045,1045,1045,1046,1046,1047,1047,1047,1048,1048,1048,1049,1049,1049,1050,1050,1051,1051,1051,1052,1052,1052,1053,1053,1054,1054,1054,1055,1055,1055,1056,1056,1056,1057,1057,1058,1058,1058,1059,1059,1059,1060,1060,1061,1061,1061,1062,1062,1062,1063,1063,1063,1064,1064,1065,1065,1065,1066,1066,1066,1067,1067,1068,1068,1068,1069,1069,1069,1070,1070,1070,1071,1071,1072,1072,1072,1073,1073,1073,1074,1074,1075,1075,1075,1076,1076,1076,1077,1077,1077,1078,1078,1079,1079,1079,1080,1080,1080,1081,1081,1082,1082,1082,1083,1083,1083,1084,1084,1084,1085,1085,1086,1086,1086,1087,1087,1087,1088,1088,1089,1089,1089,1090,1090,1090,1091,1091,1091,1092,1092,1093,1093,1093,1094,1094,1094,1095,1095,1095,1096,1096,1097,1097,1097,1098,1098,1098,1099,1099,1100,1100,1100,1101,1101,1101,1102,1102,1102,1103,1103,1104,1104,1104,1105,1105,1105,1106,1106,1107,1107,1107,1108,1108,1108,1109,1109,1110,1110,1110,1111,1111,1111,1112,1112,1112,1113,1113,1114,1114,1114,1115,1115,1115,1116,1116,1117,1117,1117,1118,1118,1118,1119,1119,1119,1120,1120,1121,1121,1121,1122,1122,1122,1123,1123,1124,1124,1124,1125,1125,1125,1126,1126,1126,1127,1127,1128,1128,1128,1129,1129,1129,1130,1130,1130,1131,1131,1132,1132,1132,1133,1133,1133,1134,1134,1135,1135,1135,1136,1136,1136,1137,1137,1137,1138,1138,1139,1139,1139,1140,1140,1140,1141,1141,1142,1142,1142,1143,1143,1143,1144,1144,1144,1145,1145,1146,1146,1146,1147,1147,1147,1148,1148,1149,1149,1149,1150,1150,1150,1151,1151,1151,1152,1152,1153,1153,1153,1154,1154,1154,1155,1155);//-1187-1955


[此贴子已经被作者于2014-2-20 9:16:01编辑过]


支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部
总数 56 上一页 1 2 3 4 5 6 下一页

返回版面帖子列表

[原创]公开电脑医生、福星、通胜万年历2014年2月最新历算源码








签名