以文本方式查看主题 - 中华农历论坛 (http://bbs.nongli.net/index.asp) -- 历法知识 (http://bbs.nongli.net/list.asp?boardid=2) ---- [分享]《电脑医生万年历》节气计算代码公开。 (http://bbs.nongli.net/dispbbs.asp?boardid=2&id=18585) |
||||
-- 作者:chwc -- 发布时间:2009/4/18 11:54:00 -- [分享]《电脑医生万年历》节气计算代码公开。 我的《电脑医生万年历》的内核是从‘知来者’或‘国日历类’修改而来,但由于‘知来者’或‘中国日历类’它设计上考虑不周到,好多地方节气显示出错。因此我对他进行改动,修改后从前104年到1645年平气和史实一样。同时也显示出定气。新代码在将在《电脑医生万年历》1.95版上开始用。《电脑医生万年历》1.95版在4月20号到5月7号之间发布到到:http://www.skycn.com/soft/50990.html 天空软件站戓到 http://www.newhua.com/soft/77731.htm 华军软件园;大家到时可去下载。 现在节气计算代码公开如下: //-------數學函數------// function sin(x){ function cos(x){ function abs(x){ function floor(x){ function round(x){ function tail(x){ function rem(x,w){ //廣義求余 //日差天數 ///-----農暦節氣函數----///// var kche=new Array(///史實平氣擬合2 function S2(y,m,d,n){ ///從-221到1645史實平氣,該函數返回史實平節氣的D0值 sN00=rem(sN00-1,24)+1;sN0=rem(sN0-1,24)+1;sN1=rem(sN1-1,24)+1; sN2=rem(sN2-1,24)+1; sN3=rem(sN3-1,24)+1; /////////以下是应用
/////////////////////////////////////////////////////////
|
||||
-- 作者:chwc -- 发布时间:2009/4/20 1:13:00 -- 更正: function jqi(y,m,d,a){到 更正为:sT2=\'$公暦\'+yr2+sM2+\'月\'+sDate2+\'日\'+\'東8區\'+dToStr(tail(sDt2))+\' 定\'+sStr(sN2);if(sN2==\'\')sT2=\'\'; |
||||
-- 作者:chwc -- 发布时间:2009/5/9 20:09:00 -- /////月相,日月食 function shwStr(y,m,d,s1){ 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 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=-1;k<=13;k+=0.25){ //k=整數為朔,k=半整數為望 var aa=aa0+0.507984293*k; var ab=ab0+6.73377553*k; var ac=ac0+6.818486628*k; 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; //朔或望的等效標準天數及時刻 //記錄當前日期的j值 var lunD0=erD(y,m,d)-floor(j); //當前日距朔日的差值 if(k==floor(k)&&lunD0>=0&&lunD0<=29){ var k1=k; //記錄當前時間對應的k值 shuoT=tail(j); lunD=lunD0+1; ///月相的错误校正(1901-2050) if(y==1924&&m==3&&d==5) shuoT=0.99932; if(y==2018&&m==11&&d==8||y==2057&&m==9&&d==29||y==2097&&m==8&&d==8) shuoT=0.0006; ///////1924.3.5-4.3 错误修正 if(y==1924&&((m==3&&d>=5)&&(m==3&&d<=7))){ lunD++; if(lunD>30){ lunD = lunD-=30; }} //2018.11.7-12.6 - 2057.9.28-10.27 - 2097.8.7-9.5 错误修正 if(y==2018&&((m==11&&d>=7)&&(m==11&&d<=9))||y==2057&&((m==9&&d>=28)&&(m==9&&d<=29))||y==2097&&((m==8&&d>=7)&&(m==8&&d<=10))){ lunD--; if(lunD<1){ lunD = lunD+=30; } } } if(k==(k1+0.25)){ shanxT=tail(j); shanxD=floor(j)-(erD(y,m,d)-lunD+1)+1; } if(k==(k1+0.5)){ wangT=tail(j); wangD=floor(j)-(erD(y,m,d)-lunD+1)+1; } if(k==(k1+0.75)){ xiaxT=tail(j); xiaxD=floor(j)-(erD(y,m,d)-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=\'(月全食)\'; //月全食 } } } } } //k循環結束 if(y==1924&&m==3&&d==5)ecli=\'(日食)\';////日食错误修正 var str=\'\'; var v1=lunD; if(s1==0){ if(v1==1)////日曆部份月相 str=\'東8區\'+dToStr(shuoT)+\'朔<font color="#666666">●</font>\'+ecli; else if(v1==shanxD)//(v1==15||v1==16)&&v2) str=\'東8區\'+dToStr(shanxT)+\'上弦<img border="0" src="7000wnldat/shanx.jpg" width="12" height="12">\'; else if(v1==wangD)//(v1==15||v1==16)&&v2) str=\'東8區\'+dToStr(wangT)+\'望<font color="#FF0000">○</font>\'+ecli; else if(v1==xiaxD)//(v1==15||v1==16)&&v2) str=\'東8區\'+dToStr(xiaxT)+\'下弦<img border="0" src="7000wnldat/xiax.jpg" width="12" height="12">\'; else; }else{ if(v1==1||v1==101||v1==201)///月曆部份月相 str=\'<font color="#666666">●</font>\'; else if(v1==shanxD)//(v1==15||v1==16)&&v2) str=\'<img border="0" src="7000wnldat/shanx.jpg" width="12" height="12">\'; else if(v1==wangD)//(v1==15||v1==16)&&v2) str=\'<font color="#FF0000">○</font>\'; else if(v1==xiaxD)//(v1==15||v1==16)&&v2) str=\'<img border="0" src="7000wnldat/xiax.jpg" width="12" height="12">\'; else; } return str; } |
||||
-- 作者:burninghot -- 发布时间:2009/9/16 11:33:00 -- 真的蛮好的..谢谢LZ |
||||
-- 作者:g2david -- 发布时间:2011/1/3 23:03:00 -- 我將Javascript 改成 C#後, 發現跟你的Javascript有差別. 差五分鐘 請師兄指教. 2011年1月6日東8區 00:59:37 定1 2011年1月20日東8區 18:24:39 定2 你的原程式: 2010/1/6 0:54:36 2010/1/20 18:18:31 看不出那裡有問題, 請幫忙 |
||||
-- 作者:g2david -- 发布时间:2011/1/3 23:16:00 -- using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace luca { class Program { double[] ykche = new double[] { 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}; double[] kche = new double[] { -221, -216, -104, 84, 236, 444, 509, 589, 596, 618, 665, 728, 761, 783, 821, 892, 955, 963, 982, 1000, 1063, 1067, 1074, 1093, 1102, 1105, 1135, 1190, 1198, 1207, 1251, 1252, 1270, 1276, 1279}; double[] jkche = new double[] { 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}; int[] jkche2 = new int[]{ -3, -3, 0, 4, 4, 3, 3, 4, 3, 3, 4, 4, 19, 3, 3, 3, 4, 4, 4, 3, 0, 4, 3, 3, 4, 4, 4, 3, 3, 3, 10, 4, 4, 4, 4}; string[] ifGr5a=new string[]{"周曆","周曆","秦曆","殷曆","殷曆","魯曆","周曆","夏曆"}; double PI(){ return Math.PI; } double sin(double x){ return Math.Sin(x); } double cos(double x){ return Math.Cos (x); } double abs(double x){ return Math.Abs(x); } double floor(double x){ return Math.Floor (x); } double round(double x){ return Math.Round(x); } double tail(double x) { return x-floor(x); } double rem(double x,double w) { return tail(x/w)*w; } double ifGr5(double y,double m,double d){ //公曆y年m月(1,2..12,下同)d日 var v=(y-1)*365+floor((y-1)/4)+D0(y,m,d)-2; if(y>1582) v+=-floor((y-1)/100)+floor((y-1)/400)+2; var jd=(v+1721425);//等效儒略日 var opt = 0; if(jd>=-10000)opt=7;//夏曆 if(jd>=1137055)opt=3;//-1599,2,1殷曆 if(jd>=1339370)opt=0;//-1046,12,30周曆 if(jd>=1457728)opt=5;//-721,1,16魯曆 if(jd>=1547530)opt=0;//-476,11,27周曆 if(jd>=1628238)opt=2;//-255,11,15秦曆 if(jd>=1683519)opt=7;//-103,3,23夏曆 if(jd>=1724360)opt=4;//9,1,15殷曆 if(jd>=1729764)opt=7;//23,11,2夏曆 if(jd>=1807725)opt=4;//237,4,13殷曆-魏 if(jd>=1808729)opt=7;//240,1,12夏曆 if(jd>=1973067)opt=1;//689,12,18周曆-武周 if(jd>=1977082)opt=7;//700,12,15夏曆 if(jd>=1999349)opt=6;//761,12,2周曆-唐肅宗 if(jd>=1999497)opt=7;//762,4,29夏曆 return opt; } //判斷Gregorian曆還是Julian曆 double ifGr(double y, double m, double d, double opt) { //陽曆y年m月(1,2,..,12,下同)d日,opt=1,2,3分別表示標準日曆,Gregorge曆和Julian曆 if(opt==1){ if(y>1582||(y==1582&&m>10)||(y==1582&&m==10&&d>14)) return(1); //Gregorian else if(y==1582&&m==10&&d>=5&&d<=14) return(-1); //空 else return(0); //Julian } if(opt==2) return(1); //Gregorian if(opt==3) return(0); //Julian return 0; } double JD(double y, double m, double d, double h, double min, double sec, double zone) { var ifG=ifGr(y,m,d,1); var jt=(h+(min+sec/60)/60)/24-0.5-zone/24; //r d=(ifG)?(erD(y,m,d)+1721425+jt):(erD(y,m,d)+1721425+jt);//儒略日 var jd= (erD(y, m, d) + 1721425 + jt); return jd; } double D0(double y, double m, double d) { var ifG=ifGr(y,m,d,1); var monL=new int[] {0,31,28,31,30,31,30,31,31,30,31,30,31}; if(ifG!=0) if((y%100!=0&&y%4==0)||(y%400==0)) monL[2]+=1; else if(y%4==0) monL[2]+=1; double v = 0; for(var i=0;i<=m-1;i++){ v+=monL[i]; } v+=d; if (y == 1582) { if (ifG == 1) v -= 10; if (ifG == -1) v = 0; //infinity } return v; } double antiD0(double y, double x) { var m=1; for(var j=1;j<=12;j++){ var mL = D0(y, m + 1, 1) - D0(y, m, 1); if (y == 1582 && m == 10) mL = 31; if(x<=mL||j==12){ m=j; break; } else x-=mL; } return 100*m+x; } double D(double y) { var v=(y-1)*365+floor((y-1)/4); //Julian腔爛船毞 if(y>1582) v+=-floor((y-1)/100)+floor((y-1)/400); //Gregorian腔爛船毞 return v; } double erD(double y, double m, double d) { var v=(y-1)*365+floor((y-1)/4)+D0(y,m,d)-2; //Julian腔脹虴??毞 if(y>1582) v+=-floor((y-1)/100)+floor((y-1)/400)+2; //Gregorian腔脹虴??毞 return v; } double S(double y, double n, int pd) { //pd?硉?0麼1ㄛ煦?桶尨??睿隅?,?滲殿隙??腔D0硉 var yk=365.2423112;///yk=365.2422226;0.00008894 var jk=y-2100; var j=0.000088931/3400*jk;if(y<2200)j=0; var="var" yk2="yk-j; " var="var" jud="y*(yk2-6.4e-14*(y-100)*(y-100)-3.047e-8*(y-100))+15.218427*n+1721050.71301;//?謹? " var="var" tht="3e-4*y-0.372781384-0.2617913325*n;//褒僅 " var="var" yrd="(1.945*sin(tht)-0.01206*sin(2*tht))*(1.048994-2.583e-5*y);//爛船?歙 " var="var" shuod="-18e-4*sin(2.313908653*y-0.439822951-3.0443*n);//侇船?歙 " double="double" vs; if="if" (pd!=0) vs="(juD+yrD+shuoD-erD(y,1,0)-1721425); " else="else" vs="(juD-erD(y,1,0)-1721425); " return="return" vs; } double="double" S2(double y, double="double" m, double="double" d, int="int" n) { ///-221善1645妢???,?滲殿隙妢????腔D0硉 var="var" jejd="round(JD(y,m,d,20,0,0,8)*1000)/1000;" var="var" ykd="(round(JD(y,1,1,20,0,0,8)*1000)/1000)-1; " var="var" jkk="0;if(jeJD">1642468)jkk=1;if(jeJD>=1683438)jkk=2;if(jeJD>=1752164)jkk=3; if(jeJD>=1807682)jkk=4;if(jeJD>=1883654)jkk=5;if(jeJD>=1907395)jkk=6;if(jeJD>=1936615)jkk=7; if(jeJD>=1939172)jkk=8;if(jeJD>=1947207)jkk=9;if(jeJD>=1964374)jkk=10;if(jeJD>=1987385)jkk=11; if(jeJD>=1999683)jkk=12;if(jeJD>=2007445)jkk=13;if(jeJD>=2021325)jkk=14;if(jeJD>=2047258)jkk=15; if(jeJD>=2070297)jkk=16;if(jeJD>=2073219)jkk=17;if(jeJD>=2080158)jkk=18;if(jeJD>=2086705)jkk=19; if(jeJD>=2110050)jkk=20;if(jeJD>=2111205)jkk=21; if(jeJD>=2113733)jkk=22;if(jeJD>=2120673)jkk=23;if(jeJD>=2123988)jkk=24; if(jeJD>=2125084)jkk=25;if(jeJD>=2136042)jkk=26;if(jeJD>=2156102)jkk=27;if(jeJD>=2159024)jkk=28; if(jeJD>=2162311)jkk=29;if(jeJD>=2178503)jkk=30;if(jeJD>=2178776)jkk=31;if(jeJD>=2185350)jkk=32; if(jeJD>=2187542)jkk=33;if(jeJD>=2188637)jkk=34; var yk2=ykche[jkk];///場 var k=kche[jkk];//爛賜 var jk=jkche[jkk];////?墿 var jk9=jkche2[jkk];///?船 var yk3=jk*(jk9*1); var yk=(yk2*1)-(yk3*1); var jq=jk*(n+(24*(y-k-1))); var vj=jq+yk-ykd+0.5;if(y<-220||y>1646||y==1646&&m>=1)vj=0; return vj; } double S2(double y, double m, double d, double n) { ///從-221到1645史實平氣,該函數返回史實平節氣的D0值 var jeJD=round(JD(y,m,d,20,0,0,8)*1000)/1000; var ykd=(round(JD(y,1,1,20,0,0,8)*1000)/1000)-1; var jkk=0;if(jeJD>1642468)jkk=1;if(jeJD>=1683438)jkk=2;if(jeJD>=1752164)jkk=3; if(jeJD>=1807682)jkk=4;if(jeJD>=1883654)jkk=5;if(jeJD>=1907395)jkk=6;if(jeJD>=1936615)jkk=7; if(jeJD>=1939172)jkk=8;if(jeJD>=1947207)jkk=9;if(jeJD>=1964374)jkk=10;if(jeJD>=1987385)jkk=11; if(jeJD>=1999683)jkk=12;if(jeJD>=2007445)jkk=13;if(jeJD>=2021325)jkk=14;if(jeJD>=2047258)jkk=15; if(jeJD>=2070297)jkk=16;if(jeJD>=2073219)jkk=17;if(jeJD>=2080158)jkk=18;if(jeJD>=2086705)jkk=19; if(jeJD>=2110050)jkk=20;if(jeJD>=2111205)jkk=21; if(jeJD>=2113733)jkk=22;if(jeJD>=2120673)jkk=23;if(jeJD>=2123988)jkk=24; if(jeJD>=2125084)jkk=25;if(jeJD>=2136042)jkk=26;if(jeJD>=2156102)jkk=27;if(jeJD>=2159024)jkk=28; if(jeJD>=2162311)jkk=29;if(jeJD>=2178503)jkk=30;if(jeJD>=2178776)jkk=31;if(jeJD>=2185350)jkk=32; if(jeJD>=2187542)jkk=33;if(jeJD>=2188637)jkk=34; var yk2=ykche[jkk];///初數 var k=kche[jkk];//年界 var jk=jkche[jkk];////氣長 var jk9=jkche2[jkk];///節差數 var yk3=jk*(jk9*1); var yk=(yk2*1)-(yk3*1); var jq=jk*(n+(24*(y-k-1))); var vj=jq+yk-ykd+0.5;if(y<-220||y>1646||y==1646&&m>=1)vj=0; return vj; } public string jqi(double y,double m,double d, double a){ var mL=D0(y,m+1,1)-D0(y,m,1); var yr2=""+y+"年"; if(y<=0) yr2="前"+(-y+1)+"年"; var sT00="";var sT0="";var sT1="";var sT2="";var sT3="";var sT4=""; var qSt="";var sDsStr1="";var ifsj1="";////節氣 var sN00=2*m-3; var sDt00=S(y,sN00,1);if(a==3)sDt00=S2(y,m,d,sN00); var sD00=antiD0(y,floor(sDt00)); var sM00=floor(sD00/100); ///節氣交接公暦月。 var sDate00=sD00%100; var sN0=2*m-2; var sDt0=S(y,sN0,1);if(a==3)sDt0=S2(y,m,d,sN0); var sD0=antiD0(y,floor(sDt0)); var sM0=floor(sD0/100); var sDate0=sD0%100; var sN1 =2*m-1; var sDt1=S(y,sN1,1);if(a==3)sDt1=S2(y,m,d,sN1); var sD1=antiD0(y,floor(sDt1)); var sM1=floor(sD1/100); var sDate1=sD1%100; var sN2=2*m; var sDt2=S(y,sN2,1);if(a==3)sDt2=S2(y,m,d,sN2); var sD2=antiD0(y,floor(sDt2)); var sM2 = floor(sD2 / 100); var sDate2 = sD2 % 100; if (y == 1582 && m == 10) sDate2 = sDate2 + 10; var sN3=2*m+1; if(sN3>24) sN3=25; var sDt3=S(y,sN3,1);if(a==3)sDt3=S2(y,m,d,sN3); var sD3=antiD0(y,floor(sDt3)); var sM3=floor(sD3/100); var sDate3=sD3%100; sN00=rem(sN00-1,24)+1;sN0=rem(sN0-1,24)+1;sN1=rem(sN1-1,24)+1; sN2=rem(sN2-1,24)+1; sN3=rem(sN3-1,24)+1; if(sDate2>mL) sDate2-=mL; var jqk=D0(y,m,d);var qk00=floor(sDt00); var qk0=floor(sDt0);var qk1=floor(sDt1);var qk2=floor(sDt2);var qk3=floor(sDt3); if(qk00 if(qk0 if(qk1 if(qk2 if(qk3 sT00="%公暦"+yr2+sM00+"月"+sDate00+"日"+"東8區"+(tail(sDt00))+" 定"+(sN00)+" ";if(sN00==0) sT00=""; sT0="*公暦"+yr2+sM0+"月"+sDate0+"日"+"東8區"+(tail(sDt0))+" 定"+(sN0)+" ";if(sN0==0) sT0=""; sT1="&公暦"+yr2+sM1+"月"+sDate1+"日"+"東8區"+(tail(sDt1))+" 定"+(sN1)+" ";if(sN1==0) sT1=""; sT2="$公暦"+yr2+sM2+"月"+sDate2+"日"+"東8區"+(tail(sDt2))+" 定"+(sN2);if(sN2==0)sT2=""; sT3=" "+"#公暦"+yr2+sM3+"月"+sDate3+"日"+"東8區"+(tail(sDt3))+" 定"+(sN3);if(sN3==0)sT3=""; var qSt5="";if(a==1)qSt5="定";if(a==2)qSt5=""+"◆"; if(jqk==qk00)if(sT00==""){sDsStr1="|";} else{sDsStr1=qSt5+(sN00.ToString ())+":東8區"+(tail(sDt00).ToString ());} if(jqk==qk0)if(sT0==""){sDsStr1="|";}else{sDsStr1=qSt5+(sN0.ToString ())+":東8區"+(tail(sDt0).ToString ());} if(jqk==qk1)if(sN1==0){sDsStr1="|";}else{sDsStr1=qSt5+(sN1.ToString ())+":東8區"+(tail(sDt1).ToString ());} if(jqk==qk2)if(sN2==0){sDsStr1="|";}else{ sDsStr1=qSt5+(sN2.ToString ())+":東8區"+(tail(sDt2).ToString ());} /// if(jqk==qk3)if(sT3==""){sDsStr1="|";}else{sDsStr1=qSt5+(sN3.ToString ())+":東8區"+(tail(sDt3).ToString ());} if(jqk==qk00)if(sT00==""){qSt="";}else{qSt=qSt5+(sN00.ToString ());} if(jqk==qk0)if(sT0==""){qSt="";}else{qSt=qSt5+(sN0.ToString ());} if(jqk==qk1)if(sT1==""){qSt="";}else{qSt=qSt5+(sN1.ToString ());} if(jqk==qk2)if(sT2==""){qSt="";}else{ qSt=qSt5+(sN2.ToString ());} if (jqk == qk3) if (sT3 == "") { qSt = ""; } else { qSt = qSt5 + (sN3.ToString()); } if(a==1){return sDsStr1;}else{ if(a==2){return qSt;}else{ if(a==3){return qSt;}else{ return sT00+sT0+sT1+sT2+sT3;}}} }/////節氣計算結束 static void Main(string[] args) { Program a = new Program(); Console.WriteLine(a.jqi(2010, 1, 1, 0)); Console.ReadKey(); } } } |
||||
-- 作者:chwc -- 发布时间:2011/1/8 22:07:00 -- 因为现在我的程序整合了许剑伟的高精历算函数。 我在2010年8月本来想直接采用许剑伟历算代码、但是因为我的软件有黄历择吉等内容、我的编程手法和他又不同,直接用他的原代码我的软件打开速度实在太慢,所以只好整合许剑伟的高精历算函数。过几天我会重发整合高精历算函数后的节气计算代码。 |
||||
-- 作者:CPU -- 发布时间:2011/3/10 2:45:00 -- 过几天我会重发整合高精历算函数后的节气计算代码。 希望能早日领教!!! |