公布以前的计算核心

因为更新了新的内核,大大提高精度,相比原来粗糙,所以将老的计算贴出:

JD2000值的计算:

m_totaldays = ((((((367.0 * year) – Math.Floor((double) ((7.0 * (year + Math.Floor((double) ((month + 9.0) / 12.0)))) / 4.0))) – Math.Floor((double) ((3.0 * (Math.Floor((double) ((year + ((month – 9.0) / 7.0)) / 100.0)) + 1.0)) / 4.0))) + Math.Floor((double) ((275.0 * month) / 9.0))) + day) + 1721029.0) + (((hour + (minute / 60.0)) + ((second / 60.0) / 60.0)) / 24.0);

罗睺的计算:

double num = (jd – 2451545.0) / 36525.0;
double num2 = num * num;
double num3 = num * num2;
double num4 = ((125.04452 – (1934.136261 * num)) + (0.0020708 * num2)) + (num3 / 450000.0);
return (num4 * this.DegToRad);

月孛的计算:

((263.2976 + ((360.0 * (jd – 2451543.5)) / 3230.9375)) % 360.0);

很久以前写的完整的计算代码:

public class NongLi
{
        private int cacheY;
        private double D = 1.0;
        private double DegToRad = 0.017453292519943295;
        private double[] dts = new double[] {
            -4000.0, 108371.7, -13036.8, 392.0, 0.0, -500.0, 17201.0, -627.82, 16.17, -0.3413, -150.0, 12200.6, -346.41, 5.403, -0.1593, 150.0,
            9113.8, -328.13, -1.647, 0.0377, 500.0, 5707.5, -391.41, 0.915, 0.3145, 900.0, 2203.4, -283.45, 13.034, -0.1778, 1300.0, 490.1,
            -57.35, 2.085, -0.0072, 1600.0, 120.0, -9.81, -1.532, 0.1403, 1700.0, 10.2, -0.91, 0.51, -0.037, 1800.0, 13.4, -0.72,
            0.202, -0.0193, 1830.0, 7.8, -1.81, 0.416, -0.0247, 1860.0, 8.3, -0.13, -0.406, 0.0292, 1880.0, -5.4, 0.32, -0.183,
            0.0173, 1900.0, -2.3, 2.06, 0.169, -0.0135, 1920.0, 21.2, 1.69, -0.304, 0.0167, 1940.0, 24.2, 1.22, -0.064, 0.0031,
            1960.0, 33.2, 0.51, 0.231, -0.0109, 1980.0, 51.0, 1.29, -0.026, 0.0032, 2000.0, 64.7, -1.66, 5.224, -0.2905, 2150.0,
            279.4, 732.95, 429.579, 0.0158, 6000.0
         };
        private static double[] E10 = new double[] {
            1.75347045673, 0.0, 0.0, 0.03341656456, 4.66925680417, 6283.0758499914, 0.00034894275, 4.62610241759, 12566.1516999828, 3.417571E-05, 2.82886579606, 3.523118349, 3.497056E-05, 2.74411800971, 5753.3848848968, 3.135896E-05,
            3.62767041758, 77713.7714681205, 2.676218E-05, 4.41808351397, 7860.4193924392, 2.342687E-05, 6.13516237631, 3930.2096962196, 1.273166E-05, 2.03709655772, 529.6909650946, 1.324292E-05, 0.74246356352, 11506.7697697936, 9.01855E-06, 2.04505443513,
            26.2983197998, 1.199167E-05, 1.10962944315, 1577.3435424478, 8.57223E-06, 3.50849156957, 398.1490034082, 7.79786E-06, 1.17882652114, 5223.6939198022, 9.9025E-06, 5.23268129594, 5884.9268465832, 7.53141E-06, 2.53339053818, 5507.5532386674,
            5.05264E-06, 4.58292563052, 18849.2275499742, 4.92379E-06, 4.20506639861, 775.522611324, 3.56655E-06, 2.91954116867, 0.0673103028, 2.84125E-06, 1.89869034186, 796.2980068164, 2.4281E-06, 0.34481140906, 5486.777843175, 3.17087E-06,
            5.84901952218, 11790.6290886588, 2.71039E-06, 0.31488607649, 10977.078804699, 2.0616E-06, 4.80646606059, 2544.3144198834, 2.05385E-06, 1.86947813692, 5573.1428014331, 2.02261E-06, 2.45767795458, 6069.7767545534, 1.26184E-06, 1.0830263021,
            20.7753954924, 1.55516E-06, 0.83306073807, 213.299095438, 1.15132E-06, 0.64544911683, 0.9803210682, 1.02851E-06, 0.63599846727, 4694.0029547076, 1.01724E-06, 4.26679821365, 7.1135470008, 9.9206E-07, 6.20992940258, 2146.1654164752,
            1.32212E-06, 3.41118275555, 2942.4634232916, 9.7607E-07, 0.6810127227, 155.4203994342, 8.5128E-07, 1.29870743025, 6275.9623029906, 7.4651E-07, 1.75508916159, 5088.6288397668, 1.01895E-06, 0.97569221824, 15720.8387848784, 8.4711E-07,
            3.67080093025, 71430.6956181291, 7.3547E-07, 4.67926565481, 801.8209311238, 7.3874E-07, 3.50319443167, 3154.6870848956, 7.8756E-07, 3.03698313141, 12036.4607348882, 7.9637E-07, 1.807913307, 17260.1546546904, 8.5803E-07, 5.98322631256,
            161000.6857376741, 5.6963E-07, 2.78430398043, 6286.5989683404, 6.1148E-07, 1.81839811024, 7084.8967811152, 6.9627E-07, 0.83297596966, 9437.762934887, 5.6116E-07, 4.38694880779, 14143.4952424306, 6.2449E-07, 3.97763880587, 8827.3902698748,
            5.1145E-07, 0.28306864501, 5856.4776591154, 5.5577E-07, 3.47006009062, 6279.5527316424, 4.1036E-07, 5.36817351402, 8429.2412664666, 5.1605E-07, 1.33282746983, 1748.016413067, 5.1992E-07, 0.18914945834, 12139.5535091068, 4.9E-07,
            0.48735065033, 1194.4470102246, 3.92E-07, 6.16832995016, 10447.3878396044, 3.5566E-07, 1.77597314691, 6812.766815086, 3.677E-07, 6.04133859347, 10213.285546211, 3.6596E-07, 2.56955238628, 1059.3819301892, 3.3291E-07, 0.59309499459,
            17789.845619785, 3.5954E-07, 1.70876111898, 2352.8661537718
         };
        private double[] E11 = new double[] {
            6283.31966747491, 0.0, 0.0, 0.00206058863, 2.67823455584, 6283.0758499914, 4.30343E-05, 2.63512650414, 12566.1516999828, 4.25264E-06, 1.59046980729, 3.523118349, 1.08977E-06, 2.96618001993, 1577.3435424478, 9.3478E-07,
            2.59212835365, 18849.2275499742, 1.19261E-06, 5.79557487799, 26.2983197998, 7.2122E-07, 1.13846158196, 529.6909650946, 6.7768E-07, 1.87472304791, 398.1490034082, 6.7327E-07, 4.40918235168, 5507.5532386674, 5.9027E-07, 2.8879703846,
            5223.6939198022, 5.5976E-07, 2.17471680261, 155.4203994342, 4.5407E-07, 0.39803079805, 796.2980068164, 3.6369E-07, 0.46624739835, 775.522611324, 2.8958E-07, 2.64707383882, 7.1135470008, 1.9097E-07, 1.84628332577, 5486.777843175,
            2.0844E-07, 5.34138275149, 0.9803210682, 1.8508E-07, 4.96855124577, 213.299095438, 1.6233E-07, 0.03216483047, 2544.3144198834, 1.7293E-07, 2.99116864949, 6275.9623029906
         };
        private double[] E12 = new double[] {
            0.0005291887, 0.0, 0.0, 8.719837E-05, 1.07209665242, 6283.0758499914, 3.09125E-06, 0.86728818832, 12566.1516999828, 2.7339E-07, 0.05297871691, 3.523118349, 1.6334E-07, 5.18826691036, 26.2983197998, 1.5752E-07,
            3.6845788943, 155.4203994342, 9.541E-08, 0.75742297675, 18849.2275499742, 8.937E-08, 2.05705419118, 77713.7714681205, 6.952E-08, 0.8267330541, 775.522611324, 5.064E-08, 4.66284525271, 1577.3435424478
         };
        private double[] E13 = new double[] { 2.89226E-06, 5.84384198723, 6283.0758499914, 3.4955E-07, 0.0, 0.0, 1.6819E-07, 5.48766912348, 12566.1516999828 };
        private double[] E14 = new double[] { 1.14084E-06, 3.14159265359, 0.0, 7.717E-08, 4.13446589358, 6283.0758499914, 7.65E-09, 3.83803776214, 12566.1516999828 };
        private double[] E15;
        private double[] E20;
        private double[] E21;
        private double[] E30;
        private double[] E31;
        private double[] E32;
        private double[] E33;
        private double EnnT;
        private double[] GXC_e;
        private double GXC_k;
        private double[] GXC_l;
        private double[] GXC_p;
        private double h;
        private double[] hcjjB = new double[] { 84381.448, -46.815, -0.00059, 0.001813 };
        private int inth = 12;
        private int intm;
        private int ints;
        public int J2000 = 0x256859;
        private string[] jqB;
        private double m;
        private double M = 1.0;
        private double[] M10;
        private double[] M11;
        private double[] M12;
        private double[] M1n;
        private double[] M20;
        private double[] M21;
        private double[] M30;
        private double[] M31;
        private double MnnT;
        private double[] nutB = new double[] {
            2.1824391966, -33.757045954, 3.62262E-05, 3.734E-08, -2.8793E-10, -171996.0, -1742.0, 92025.0, 89.0, 3.5069406862, 1256.663930738, 1.05845E-05, 6.9813E-10, -2.2815E-10, -13187.0, -16.0,
            5736.0, -31.0, 1.3375032491, 16799.418221925, -5.11866E-05, 6.4626E-08, -5.3543E-10, -2274.0, -2.0, 977.0, -5.0, 4.3648783932, -67.514091907, 7.24525E-05, 7.4681E-08, -5.7586E-10,
            2062.0, 2.0, -895.0, 5.0, 0.0431251803, -628.301955171, 2.682E-06, 6.5935E-10, 5.5705E-11, -1426.0, 34.0, 54.0, -1.0, 2.3555557435, 8328.691425719, 0.0001545547,
            2.5033E-07, -1.1863E-09, 712.0, 1.0, -7.0, 0.0, 3.4638155059, 1884.965885909, 7.9025E-06, 3.8785E-11, -2.8386E-10, -517.0, 12.0, 224.0, -6.0, 5.4382493597,
            16833.175267879, -8.74129E-05, 2.7285E-08, -2.475E-10, -386.0, -4.0, 200.0, 0.0, 3.6930589926, 25128.109647645, 0.0001033681, 3.1496E-07, -1.7218E-09, -301.0, 0.0, 129.0,
            -1.0, 3.5500658664, 628.361975567, 1.32664E-05, 1.3575E-09, -1.7245E-10, 217.0, -5.0, -95.0, 3.0
         };
        private double[] preceB = new double[] { 0.0, 50287.92262, 111.24406, 0.07699, -0.23479, -0.00178, 0.00018, 1E-05 };
        private double rad = 206264.80624709636;
        private double RAD = 57.295779513082323;
        private double s;
        private double Y = 2000.0;
        private string[] yueMing;
        public 年节气 本年节气;
        public 公历时间[] 二十四节气;
        public 农历月初一[] 农历列表;

        public NongLi()
        {
            double[] numArray = new double[3];
            numArray[0] = 8.78E-09;
            numArray[1] = 3.14159265359;
            this.E15 = numArray;
            this.E20 = new double[] {
                2.7962E-06, 3.19870156017, 84334.6615813083, 1.01643E-06, 5.42248619256, 5507.5532386674, 8.0445E-07, 3.88013204458, 5223.6939198022, 4.3806E-07, 3.70444689758, 2352.8661537718, 3.1933E-07, 4.00026369781, 1577.3435424478, 2.2724E-07,
                3.9847383156, 1047.7473117547, 1.6392E-07, 3.56456119782, 5856.4776591154, 1.8141E-07, 4.98367470263, 6283.0758499914, 1.4443E-07, 3.70275614914, 9437.762934887, 1.4304E-07, 3.41117857525, 10213.285546211
             };
            this.E21 = new double[] { 9.03E-08, 3.8972906189, 5507.5532386674, 6.177E-08, 1.73038850355, 5223.6939198022 };
            this.E30 = new double[] {
                1.00013988799, 0.0, 0.0, 0.01670699626, 3.09846350771, 6283.0758499914, 0.00013956023, 3.0552460962, 12566.1516999828, 3.08372E-05, 5.19846674381, 77713.7714681205, 1.628461E-05, 1.17387749012, 5753.3848848968, 1.575568E-05,
                2.84685245825, 7860.4193924392, 9.24799E-06, 5.45292234084, 11506.7697697936, 5.42444E-06, 4.56409149777, 3930.2096962196
             };
            this.E31 = new double[] { 0.00103018608, 1.10748969588, 6283.0758499914, 1.721238E-05, 1.06442301418, 12566.1516999828, 7.02215E-06, 3.14159265359, 0.0 };
            this.E32 = new double[] { 4.359385E-05, 5.78455133738, 6283.0758499914 };
            this.E33 = new double[] { 1.44595E-06, 4.27319435148, 6283.0758499914 };
            this.M10 = new double[] {
                22639.58588, 2.3555545723, 8328.6914247251, 0.00015231275, 2.5041111E-07, -1.1863391E-09, 4586.4383203, 8.0413790709, 7214.0628654588, -0.00021850087, -1.8646419E-07, 8.7760973E-10, 2369.9139357, 10.3969336431, 15542.754290184, -6.6188121E-05,
                6.3946925E-08, -3.0872935E-10, 769.0257187, 4.7111091445, 16657.3828494503, 0.0003046255, 5.0082223E-07, -2.3726782E-09, -666.4175399, -0.0431256817, 628.3019552485, -2.6638815E-06, 6.1639211E-10, -5.4439728E-11, -411.5957339, 3.2558104895,
                16866.932315281, -0.00012804259, -9.8998954E-09, 4.0433461E-11, 211.6555524, 5.6858244986, -1114.6285592663, -0.00037081362, -4.368753E-07, 2.0639488E-09, 205.435953, 8.0845047526, 6585.7609102104, -0.00021583699, -1.8708058E-07, 9.3204945E-10,
                191.9561973, 12.7524882154, 23871.4457149091, 8.6124629E-05, 3.1435804E-07, -1.4950684E-09, 164.7286185, 10.4400593249, 14914.4523349355, -6.352424E-05, 6.3330532E-08, -2.5428962E-10, -147.3213842, -2.398680254, -7700.3894694766, -0.00015497663,
                -2.4979472E-07, 1.1318993E-09, -124.9881185, 5.1984668216, 7771.377145092, -3.3094061E-05, 3.1973462E-08, -1.5436468E-10, -109.3803637, 2.3124288905, 8956.9933799736, 0.00014964887, 2.5102751E-07, -1.2407788E-09, 55.1770578, 7.1411231536,
                -1324.178025097, 6.1854469E-05, 7.384682E-08, -3.4916281E-10, -45.0996092, 5.6113650618, 25195.6237400061, 2.4270161E-05, 2.4051122E-07, -1.1459056E-09, 39.533301, -0.9002559173, -8538.2408905558, 0.00028035534, 2.6031101E-07, -1.2267725E-09,
                38.4298346, 18.438312714, 22756.8171556428, -0.00028468899, -1.2251727E-07, 5.6888037E-10, 36.1238141, 7.0666637168, 24986.0742741754, 0.00045693825, 7.5123334E-07, -3.5590172E-09, 30.7725751, 16.0827581417, 14428.1257309177, -0.00043700174,
                -3.7292838E-07, 1.7552195E-09, -28.3971008, 7.9982533891, 7842.3648207073, -0.00022116475, -1.858478E-07, 8.2317E-10, -24.3582283, 10.3538079614, 16171.0562454324, -6.8852003E-05, 6.4563317E-08, -3.6316908E-10, -18.5847068, 2.8429122493,
                -557.3142796331, -0.00018540681, -2.1843765E-07, 1.0319744E-09, 17.9544674, 5.1553411398, 8399.6791003405, -3.5757942E-05, 3.2589854E-08, -2.088044E-10, 14.5302779, 12.7956138971, 23243.1437596606, 8.8788511E-05, 3.1374165E-07, -1.4406287E-09,
                14.3796974, 15.1080427876, 32200.1371396342, 0.00023843738, 5.6476915E-07, -2.6814075E-09, 14.2514576, -24.081036632, -2.3011998397, 0.00015231275, 2.5041111E-07, -1.1863391E-09, 13.8990596, 20.7938672862, 31085.5085803679, -0.00013237624,
                1.2789385E-07, -6.174587E-10, 13.1940636, 3.3302699264, -9443.3199839914, -0.00052312637, -6.8728642E-07, 3.2502879E-09, -9.6790568, -4.7542348263, -16029.0808942018, -0.00030728938, -5.0020584E-07, 2.3182384E-09, -9.3658635, 11.2971895604,
                24080.9951807398, -0.00034654346, -1.9636409E-07, 9.1804319E-10, 8.6055318, 5.7289501804, -1742.9305145148, -0.00036814974, -4.374917E-07, 2.1183885E-09, -8.4530982, 7.5540213938, 16100.0685698171, 0.00011921869, 2.8238458E-07, -1.3407038E-09,
                8.0501724, 10.4831850066, 14286.150379687, -6.0860358E-05, 6.271414E-08, -1.998499E-10, -7.6301553, 4.6679834628, 17285.6848046987, 0.00030196162, 5.0143862E-07, -2.4271179E-09, -7.4474952, -0.0862513635, 1256.603910497, -5.327763E-06,
                1.2327842E-09, -1.0887946E-10, 7.3712011, 8.1276304344, 5957.4589549619, -0.00021317311, -1.8769697E-07, 9.8648918E-10, 7.06299, 0.9591375719, 33.7570471374, -3.0829302E-05, -3.6967043E-08, 1.7385419E-10, -6.3831491, 9.4966777258,
                7004.5133996281, 0.00021416722, 3.2425793E-07, -1.5355019E-09, -5.7416071, 13.6527441326, 32409.6866054649, -0.00019423071, 5.4047029E-08, -2.6829589E-10, 4.3740095, 18.4814383957, 22128.5152003943, -0.00028202511, -1.2313366E-07, 6.233201E-10,
                -3.9976134, 7.966919634, 33524.3151647312, 0.00017658291, 4.9092233E-07, -2.3322447E-09, -3.2096876, 13.2398458924, 14985.4400105508, -0.00025159493, -1.5449073E-07, 7.2324505E-10, -2.9145404, 12.7093625336, 24499.7476701576, 8.3460748E-05,
                3.1497443E-07, -1.5495082E-09, 2.731889, 16.1258838235, 13799.8237756692, -0.00043433786, -3.7354477E-07, 1.8096592E-09, -2.5679459, -2.4418059357, -7072.0875142282, -0.00015764051, -2.4917833E-07, 1.0774596E-09, -2.521199, 7.9551277074,
                8470.6667759558, -0.00022382863, -1.8523141E-07, 7.6873027E-10, 2.4888871, 5.6426988169, -486.3266040178, -0.0003734775, -4.3625891E-07, 2.0095091E-09, 2.1460741, 7.1842488353, -1952.4799803455, 6.451835E-05, 7.3230428E-08, -2.9472308E-10,
                1.977727, 23.1494218585, 39414.200005093, 1.9936508E-05, 3.7830496E-07, -1.8037978E-09, 1.9336825, 9.422218289, 33314.7656989005, 0.000609251, 1.0016445E-06, -4.7453563E-09, 1.8707647, 20.836992968, 30457.2066251194, -0.00012971236,
                1.2727746E-07, -5.6301898E-10, -1.7529659, 0.4873576771, -8886.0057043583, -0.00033771956, -4.6884877E-07, 2.2183135E-09, -1.4371624, 7.0979974718, -695.8760698485, 5.9190587E-05, 7.4463212E-08, -4.0360254E-10, -1.3725701, 1.455298655,
                -209.5494658307, 0.00043266809, 5.1072212E-07, -2.4131116E-09, 1.2618162, 7.5108957121, 16728.3705250656, 0.00011655481, 2.8300097E-07, -1.3951435E-09
             };
            this.M11 = new double[] {
                1.6768, -0.0431256817, 628.3019552485, -2.6638815E-06, 6.1639211E-10, -5.4439728E-11, 0.51642, 11.2260974062, 6585.7609102104, -0.00021583699, -1.8708058E-07, 9.3204945E-10, 0.41383, 13.5816519784, 14914.4523349355, -6.352424E-05,
                6.3330532E-08, -2.5428962E-10, 0.37115, 5.5402729076, 7700.3894694766, 0.00015497663, 2.4979472E-07, -1.1318993E-09, 0.2756, 2.3124288905, 8956.9933799736, 0.00014964887, 2.5102751E-07, -1.2407788E-09, 0.2459863, -25.6198212459,
                -2.3011998397, 0.00015231275, 2.5041111E-07, -1.1863391E-09, 0.07118, 7.9982533891, 7842.3648207073, -0.00022116475, -1.858478E-07, 8.2317E-10, 0.06128, 10.3538079614, 16171.0562454324, -6.8852003E-05, 6.4563317E-08, -3.6316908E-10
             };
            this.M12 = new double[] {
                0.00487, -0.0431256817, 628.3019552485, -2.6638815E-06, 6.1639211E-10, -5.4439728E-11, 0.00228, -27.1705318325, -2.3011998397, 0.00015231275, 2.5041111E-07, -1.1863391E-09, 0.0015, 11.2260974062, 6585.7609102104, -0.00021583699,
                -1.8708058E-07, 9.3204945E-10
             };
            this.M20 = new double[] {
                18461.24006, 1.6279052448, 8433.4661576405, -6.4021295E-05, -4.9499477E-09, 2.0216731E-11, 1010.1671484, 3.983459817, 16762.1575823656, 8.8291456E-05, 2.4546117E-07, -1.1661223E-09, 999.6936555, 0.7276493275, -104.7747329154, 0.00021633405,
                2.5536106E-07, -1.2065558E-09, 623.6524746, 8.7690283983, 7109.2881325435, -2.1668263E-06, 6.8896872E-08, -3.2894608E-10, 199.4837596, 9.6692843156, 15647.5290230993, -0.00028252217, -1.9141414E-07, 8.9782646E-10, 166.5741153, 6.4134738261,
                -1219.4032921817, -0.00015447958, -1.8151424E-07, 8.57393E-10, 117.2606951, 12.0248388879, 23976.2204478244, -0.00013020942, 5.8996977E-08, -2.8851262E-10, 61.9119504, 6.3390143893, 25090.8490070907, 0.00024060421, 4.9587228E-07, -2.3524614E-09,
                33.3572027, 11.1245829706, 15437.9795572686, 0.00015014592, 3.1930799E-07, -1.5152852E-09, 31.7596709, 3.0832038997, 8223.9166918098, 0.0003686468, 5.0577218E-07, -2.3928949E-09, 29.5766003, 8.8121540801, 6480.986177295, 4.9705523E-07,
                6.828048E-08, -2.7450635E-10, 15.5662654, 4.0579192538, -9548.0947169068, -0.00030679233, -4.3192536E-07, 2.0437321E-09, 15.1215543, 14.3803934601, 32304.9118725496, 2.2103334E-05, 3.0940809E-07, -1.4748517E-09, -12.0941511, 8.7259027166,
                7737.590087792, -4.8307078E-06, 6.9513264E-08, -3.8338581E-10, 8.8681426, 9.7124099974, 15019.2270678508, -0.00027985829, -1.9203053E-07, 9.5226618E-10, 8.04504, 0.6687636586, 8399.709110503, -3.3191993E-05, 3.2017096E-08, -1.5363746E-10,
                7.9585542, 12.0679645696, 23347.918492576, -0.00012754553, 5.8380585E-08, -2.3407289E-10, 7.434555, 6.4565995078, -1847.7052474301, -0.0001518157, -1.8213063E-07, 9.1183272E-10, -6.7314363, -4.0265854988, -16133.8556271171, -9.0955337E-05,
                -2.4484477E-07, 1.1116826E-09, 6.579575, 16.8104074692, 14323.3509980023, -0.0002206677, -1.1756732E-07, 5.4866364E-10, -6.4600721, 1.584779563, 9061.768112889, -6.6685176E-05, -4.3335556E-09, -3.4222998E-11, -6.2964773, 4.8837157343,
                25300.3984729215, -0.00019206388, -1.4849843E-08, 6.0650192E-11, -5.6323538, -0.7707750092, 733.0766881638, -0.00021899793, -2.5474467E-07, 1.1521161E-09, -5.3683961, 6.8263720663, 16204.8433027325, -9.7115356E-05, 2.7023515E-08, -1.3414795E-10,
                -5.3112784, 3.9403341353, 17390.4595376141, 8.5627574E-05, 2.4607756E-07, -1.2205621E-09, -5.0759179, 0.6845236457, 523.5272223331, 0.00021367016, 2.5597745E-07, -1.2609955E-09, -4.8396143, -1.6710309265, -7805.164202392, 6.1357413E-05,
                5.5663398E-09, -7.4656459E-11, -4.8057401, 3.5705615768, -662.0890125485, 3.0927234E-05, 3.692341E-08, -1.7458141E-10, 3.9840545, 8.6945689615, 33419.5404318159, 0.00039291696, 7.462834E-07, -3.5388005E-09, 3.6744619, 19.1659620415,
                22652.0424227274, -6.8354947E-05, 1.328438E-07, -6.3767543E-10, 2.9984815, 20.0662179587, 31190.2833132833, -0.00034871029, -1.2746721E-07, 5.890971E-10, 2.7986413, -2.528161162, -16971.7070481963, 0.00034437664, 2.6526096E-07, -1.2469893E-09,
                2.4138774, 17.7106633865, 22861.5918885581, -0.00050102304, -3.7787833E-07, 1.7754362E-09, 2.1863132, 5.5132179088, -9757.6441827375, 0.00012587576, 7.8796768E-08, -3.6937954E-10, 2.1461692, 13.4801375428, 23766.6709819937, 0.00030245868,
                5.697191E-07, -2.7016242E-09, 1.7659832, 11.1677086523, 14809.6776020201, 0.00015280981, 3.1869159E-07, -1.4608454E-09, -1.6244212, 7.3137297434, 7318.8375983742, -0.00043483492, -4.4182525E-07, 2.0841655E-09, 1.5813036, 5.438758472,
                16552.6081165349, 0.00052095955, 7.5618329E-07, -3.579234E-09, 1.5197528, 16.7359480324, 40633.6032972747, 0.00017441609, 5.5981921E-07, -2.6611908E-09, 1.5156341, 1.7023646816, -17876.7861416319, -0.00045910508, -6.8233647E-07, 3.2300712E-09,
                1.5102092, 5.497729645, 8399.6847301375, -3.3094061E-05, 3.1973462E-08, -1.5436468E-10, -1.3178223, 9.6261586339, 16275.8309783478, -0.00028518605, -1.9079775E-07, 8.4338673E-10, -1.2642739, 11.9817132061, 24604.5224030729, -0.0001328733,
                5.9613369E-08, -3.4295235E-10, 1.1918723, 22.421772531, 39518.9747380084, -0.00019639754, 1.229439E-07, -5.9724197E-10, 1.134611, 14.4235191419, 31676.6099173011, 2.4767216E-05, 3.087917E-07, -1.420412E-09, 1.085781, 8.8552797618,
                5852.6842220465, 3.1609367E-06, 6.7664088E-08, -2.2006663E-10, -1.0193852, 7.2392703065, 33629.0898976466, -3.9751134E-05, 2.3556127E-07, -1.1256889E-09, -0.8227141, 11.0814572888, 16066.2815125171, 0.00014748204, 3.1992438E-07, -1.5697249E-09,
                0.8042238, 3.527435895, -33.7870573, 2.8263353E-05, 3.7539802E-08, -2.2902113E-10, 0.8025939, 6.7832463846, 16833.1452579809, -9.9779237E-05, 2.7639907E-08, -1.8858767E-10, -0.7931866, -6.382140071, -24462.5470518423, -0.00024326809,
                -4.9525589E-07, 2.2980217E-09, -0.7910153, 6.3703481443, -591.1013369332, -0.00015714346, -1.8089785E-07, 8.0295327E-10, -0.6674056, 9.1819266386, 24533.5347274576, 5.5197395E-05, 2.7743463E-07, -1.320487E-09, 0.6502226, 4.1010449356,
                -10176.3966721553, -0.00030412845, -4.3254175E-07, 2.0981718E-09, -0.6388131, 6.2958887075, 25719.1509623392, 0.00023794032, 4.9648867E-07, -2.4069012E-09
             };
            this.M21 = new double[] {
                0.0743, 11.9537467337, 6480.986177295, 4.9705523E-07, 6.828048E-08, -2.7450635E-10, 0.03043, 8.7259027166, 7737.590087792, -4.8307078E-06, 6.9513264E-08, -3.8338581E-10, 0.02229, 12.854002651, 15019.2270678508, -0.00027985829,
                -1.9203053E-07, 9.5226618E-10, 0.01999, 15.2095572232, 23347.918492576, -0.00012754553, 5.8380585E-08, -2.3407289E-10, 0.01869, 9.5981921614, -1847.7052474301, -0.0001518157, -1.8213063E-07, 9.1183272E-10, 0.01696, 7.1681781524,
                16133.8556271171, 9.0955337E-05, 2.4484477E-07, -1.1116826E-09, 0.01623, 1.584779563, 9061.768112889, -6.6685176E-05, -4.3335556E-09, -3.4222998E-11, 0.01419, -0.7707750092, 733.0766881638, -0.00021899793, -2.5474467E-07, 1.1521161E-09
             };
            this.M30 = new double[] {
                385000.5290396, 1.5707963268, 0.0, 0.0, 0.0, 0.0, -20905.3551378, 3.926350899, 8328.6914247251, 0.00015231275, 2.5041111E-07, -1.1863391E-09, -3699.110933, 9.6121753977, 7214.0628654588, -0.00021850087,
                -1.8646419E-07, 8.7760973E-10, -2955.9675626, 11.9677299699, 15542.754290184, -6.6188121E-05, 6.3946925E-08, -3.0872935E-10, -569.9251264, 6.2819054713, 16657.3828494503, 0.0003046255, 5.0082223E-07, -2.3726782E-09, 246.1584797, 7.2566208254,
                -1114.6285592663, -0.00037081362, -4.368753E-07, 2.0639488E-09, -204.5861179, 12.0108556517, 14914.4523349355, -6.352424E-05, 6.3330532E-08, -2.5428962E-10, -170.7330791, 14.3232845422, 23871.4457149091, 8.6124629E-05, 3.1435804E-07, -1.4950684E-09,
                -152.1378118, 9.6553010794, 6585.7609102104, -0.00021583699, -1.8708058E-07, 9.3204945E-10, -129.6202242, -0.8278839272, -7700.3894694766, -0.00015497663, -2.4979472E-07, 1.1318993E-09, 108.7427014, 6.7692631483, 7771.377145092, -3.3094061E-05,
                3.1973462E-08, -1.5436468E-10, 104.7552944, 3.8832252173, 8956.9933799736, 0.00014964887, 2.5102751E-07, -1.2407788E-09, 79.6605685, 0.6705404095, -8538.2408905558, 0.00028035534, 2.6031101E-07, -1.2267725E-09, 48.8883284, 1.527670645,
                628.3019552485, -2.6638815E-06, 6.1639211E-10, -5.4439728E-11, -34.7825237, 20.0091090408, 22756.8171556428, -0.00028468899, -1.2251727E-07, 5.6888037E-10, 30.8238599, 11.9246042882, 16171.0562454324, -6.8852003E-05, 6.4563317E-08, -3.6316908E-10,
                24.2084985, 9.5690497159, 7842.3648207073, -0.00022116475, -1.858478E-07, 8.2317E-10, -23.2104305, 8.6374600436, 24986.0742741754, 0.00045693825, 7.5123334E-07, -3.5590172E-09, -21.6363439, 17.6535544685, 14428.1257309177, -0.00043700174,
                -3.7292838E-07, 1.7552195E-09, -16.6747239, 6.7261374666, 8399.6791003405, -3.5757942E-05, 3.2589854E-08, -2.088044E-10, 14.402689, 4.9010662531, -9443.3199839914, -0.00052312637, -6.8728642E-07, 3.2502879E-09, -12.8314035, 14.3664102239,
                23243.1437596606, 8.8788511E-05, 3.1374165E-07, -1.4406287E-09, -11.6499478, 22.364663613, 31085.5085803679, -0.00013237624, 1.2789385E-07, -6.174587E-10, -10.4447578, 16.6788391144, 32200.1371396342, 0.00023843738, 5.6476915E-07, -2.6814075E-09,
                10.3211071, 8.7119194804, -1324.178025097, 6.1854469E-05, 7.384682E-08, -3.4916281E-10, 10.0562033, 7.2997465071, -1742.9305145148, -0.00036814974, -4.374917E-07, 2.1183885E-09, -9.8844667, 12.0539813334, 14286.150379687, -6.0860358E-05,
                6.271414E-08, -1.998499E-10, 8.7515625, 6.3563649081, -9652.8694498221, -9.0458282E-05, -1.7656429E-07, 8.3717626E-10, -8.3791067, 4.4137085761, -557.3142796331, -0.00018540681, -2.1843765E-07, 1.0319744E-09, -7.0026961, -3.1834384995,
                -16029.0808942018, -0.00030728938, -5.0020584E-07, 2.3182384E-09, 6.3220032, 9.1248177206, 16100.0685698171, 0.00011921869, 2.8238458E-07, -1.3407038E-09, 5.7508579, 6.2387797896, 17285.6848046987, 0.00030196162, 5.0143862E-07, -2.4271179E-09,
                -4.9501349, 9.6984267611, 5957.4589549619, -0.00021317311, -1.8769697E-07, 9.8648918E-10, -4.421177, 3.0260949818, -209.5494658307, 0.00043266809, 5.1072212E-07, -2.4131116E-09, 4.1311145, 11.0674740526, 7004.5133996281, 0.00021416722,
                3.2425793E-07, -1.5355019E-09, -3.9579827, 20.0522347225, 22128.5152003943, -0.00028202511, -1.2313366E-07, 6.233201E-10, 3.2582371, 14.8106422192, 14985.4400105508, -0.00025159493, -1.5449073E-07, 7.2324505E-10, -3.148302, 4.8266068163,
                16866.932315281, -0.00012804259, -9.8998954E-09, 4.0433461E-11, 2.6164092, 14.2801588604, 24499.7476701576, 8.3460748E-05, 3.1497443E-07, -1.5495082E-09, 2.353631, 9.5259240341999991, 8470.6667759558, -0.00022382863, -1.8523141E-07, 7.6873027E-10,
                -2.1171283, -0.871009609, -7072.0875142282, -0.00015764051, -2.4917833E-07, 1.0774596E-09, -1.8970368, 17.6966801503, 13799.8237756692, -0.00043433786, -3.7354477E-07, 1.8096592E-09, -1.7385258, 2.0581540038, -8886.0057043583, -0.00033771956,
                -4.6884877E-07, 2.2183135E-09, -1.5713944, 22.4077892948, 30457.2066251194, -0.00012971236, 1.2727746E-07, -5.6301898E-10, -1.4225541, 24.7202181853, 39414.200005093, 1.9936508E-05, 3.7830496E-07, -1.8037978E-09, -1.4189284, 17.1661967915,
                23314.1314352759, -9.9282182E-05, 9.5920387E-08, -4.6309403E-10, 1.1655364, 3.8400995356, 9585.2953352221, 0.00014698499, 2.516439E-07, -1.2952185E-09, -1.1169371, 10.9930146158, 33314.7656989005, 0.000609251, 1.0016445E-06, -4.7453563E-09,
                1.0656723, 1.4845449633, 1256.603910497, -5.327763E-06, 1.2327842E-09, -1.0887946E-10, 1.058619, 11.9220903668, 8364.7398411275, -0.00021850087, -1.8646419E-07, 8.7760973E-10, -0.9333176, 9.0816920389, 16728.3705250656, 0.00011655481,
                2.8300097E-07, -1.3951435E-09, 0.8624328, 12.455087647, 6656.7485858257, -0.00040390768, -4.0490184E-07, 1.9095841E-09, 0.8512404, 4.3705828944, 70.9876756153, -0.00018807069, -2.1782126E-07, 9.7753467E-10, -0.8488018, 16.7219647962,
                31571.8351843857, 0.00024110126, 5.6415276E-07, -2.6269678E-09, -0.7956264, 3.5134526588, -9095.555170189, 9.4948529E-05, 4.1873358E-08, -1.9479814E-10
             };
            this.M31 = new double[] {
                0.51395, 12.0108556517, 14914.4523349355, -6.352424E-05, 6.3330532E-08, -2.5428962E-10, 0.38245, 9.6553010794, 6585.7609102104, -0.00021583699, -1.8708058E-07, 9.3204945E-10, 0.32654, 3.9694765808, 7700.3894694766, 0.00015497663,
                2.4979472E-07, -1.1318993E-09, 0.26396, 0.7416325637, 8956.9933799736, 0.00014964887, 2.5102751E-07, -1.2407788E-09, 0.12302, -1.6139220085, 628.3019552485, -2.6638815E-06, 6.1639211E-10, -5.4439728E-11, 0.07754, 8.7830116346,
                16171.0562454324, -6.8852003E-05, 6.4563317E-08, -3.6316908E-10, 0.06068, 6.4274570623, 7842.3648207073, -0.00022116475, -1.858478E-07, 8.2317E-10, 0.0497, 12.0539813334, 14286.150379687, -6.0860358E-05, 6.271414E-08, -1.998499E-10
             };
            this.M1n = new double[] { 3.81034392032, 8399.68473021, -3.31919929753E-05, 3.20170955005E-08, -1.53637455544E-10 };
            this.jqB = new string[] {
                "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬",
                "小雪", "大雪", "冬至", "小寒", "大寒", "立春", "雨水", "惊蛰"
             };
            this.yueMing = new string[] { "正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二" };
            this.cacheY = -65535;
            this.本年节气 = new 年节气();
            this.二十四节气 = new 公历时间[0x1a];
            this.农历列表 = new 农历月初一[13];
            this.GXC_e = new double[] { 0.016708634, -4.2037E-05, -1.267E-07 };
            this.GXC_p = new double[] { 102.93735 / this.RAD, 1.71946 / this.RAD, 0.00046 / this.RAD };
            this.GXC_l = new double[] { 280.4664567 / this.RAD, 36000.76982779 / this.RAD, 0.0003032028 / this.RAD, 0.0 / this.RAD, 0.0 / this.RAD };
            this.GXC_k = 20.49552 / this.rad;
        }

        private void addGxc(double t, double[] zb)
        {
            double num = t / 36525.0;
            double num2 = num * num;
            double num3 = num2 * num;
            double num4 = num3 * num;
            double num5 = (((this.GXC_l[0] + (this.GXC_l[1] * num)) + (this.GXC_l[2] * num2)) + (this.GXC_l[3] * num3)) + (this.GXC_l[4] * num4);
            double num6 = (this.GXC_p[0] + (this.GXC_p[1] * num)) + (this.GXC_p[2] * num2);
            double num7 = (this.GXC_e[0] + (this.GXC_e[1] * num)) + (this.GXC_e[2] * num2);
            double d = num5 – zb[0];
            double num9 = num6 – zb[0];
            zb[0] -= (this.GXC_k * (Math.Cos(d) – (num7 * Math.Cos(num9)))) / Math.Cos(zb[1]);
            zb[1] -= (this.GXC_k * Math.Sin(zb[1])) * (Math.Sin(d) – (num7 * Math.Sin(num9)));
            zb[0] = this.rad2mrad(zb[0]);
        }

        private void addPrece(double jd, double[] zb)
        {
            double num2 = 1.0;
            double num3 = 0.0;
            double num4 = jd / 365250.0;
            for (int i = 1; i < 8; i++)
            {
                num2 *= num4;
                num3 += this.preceB[i] * num2;
            }
            zb[0] = this.rad2mrad(zb[0] + ((num3 + (2.9965 * num4)) / this.rad));
        }

        public void Compute(int y)
        {
            if (this.cacheY != y)
            {
                int num;
                this.cacheY = y;
                double[] numArray = new double[14];
                double[] numArray2 = new double[14];
                double[] numArray3 = new double[14];
                double num2 = (365.24219879 * (y – 0x7d0)) – 50.0;
                for (num = 0; num < 14; num++)
                {
                    numArray[num] = this.jiaoCal(num2 + (num * 30.4), (double) ((num * 30) – 90), 0.0);
                    numArray2[num] = this.jiaoCal(num2 + (num * 30.4), (double) ((num * 30) – 0x69), 0.0);
                }
                double num3 = (numArray[0] + 1.0) – this.Dint_dec(numArray[0], 8.0, false);
                numArray3[0] = this.jiaoCal(num3, 0.0, 1.0);
                for (num = 1; num < 14; num++)
                {
                    numArray3[num] = this.jiaoCal(numArray3[num – 1] + 25.0, 0.0, 1.0);
                }
                double[] numArray4 = new double[14];
                double[] numArray5 = new double[14];
                double[] numArray6 = new double[14];
                for (num = 0; num < 14; num++)
                {
                    numArray4[num] = this.Dint_dec(numArray[num], 8.0, true);
                    numArray5[num] = this.Dint_dec(numArray2[num], 8.0, true);
                    numArray6[num] = this.Dint_dec(numArray3[num], 8.0, true);
                }
                double num4 = 13.0;
                double num5 = -1.0;
                int[] numArray7 = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0 };
                string[] strArray = new string[numArray7.Length];
                if (numArray6[12] <= numArray4[12])
                {
                    numArray7[12] = 12;
                    num4 = 13.0;
                    num = 1;
                    while (num < 13)
                    {
                        if (numArray6[num] <= numArray4[num])
                        {
                            break;
                        }
                        num++;
                    }
                    num5 = num – 1;
                    while (num < 13)
                    {
                        numArray7[num – 1]–;
                        num++;
                    }
                }
                num = 0;
                while (num < num4)
                {
                    this.农历列表[num] = new 农历月初一();
                    strArray[num] = this.yueMing[(numArray7[num] + 10) % 12];
                    this.农历列表[num].Yueming = (numArray7[num] + 10) % 12;
                    if (num == num5)
                    {
                        this.农历列表[num].isRun = true;
                    }
                    else
                    {
                        this.农历列表[num].isRun = false;
                    }
                    if ((numArray6[num + 1] – numArray6[num]) > 29.0)
                    {
                        this.农历列表[num].isDa = true;
                    }
                    else
                    {
                        this.农历列表[num].isDa = false;
                    }
                    num++;
                }
                for (num = 0; num < num4; num++)
                {
                    int num1 = ((num * 2) + 0x12) % 0x18;
                    int num6 = ((num * 2) + 0x11) % 0x18;
                    this.setFromJD((numArray2[num] + this.J2000) + 0.33333333333333331, true);
                    this.二十四节气[2 * num] = new 公历时间((int) this.Y, (int) this.M, (int) this.D, (int) this.h, (int) this.m, (int) this.s);
                    this.本年节气.SetJieQiByIndex((2 * num) – 1, new 公历时间((int) this.Y, (int) this.M, (int) this.D, (int) this.h, (int) this.m, (int) this.s));
                    this.setFromJD((numArray[num] + this.J2000) + 0.33333333333333331, true);
                    this.二十四节气[(2 * num) + 1] = new 公历时间((int) this.Y, (int) this.M, (int) this.D, (int) this.h, (int) this.m, (int) this.s);
                    this.本年节气.SetJieQiByIndex(2 * num, new 公历时间((int) this.Y, (int) this.M, (int) this.D, (int) this.h, (int) this.m, (int) this.s));
                    this.setFromJD((numArray3[num] + this.J2000) + 0.33333333333333331, true);
                    this.toJD(false);
                    this.农历列表[num].datetime = new 公历时间((int) this.Y, (int) this.M, (int) this.D, (int) this.h, (int) this.m, (int) this.s);
                }
            }
        }

        private double deltatT(double y)
        {
            double[] dts = this.dts;
            int index = 0;
            while (index < 100)
            {
                if ((y < dts[index + 5]) || (index == 0x5f))
                {
                    break;
                }
                index += 5;
            }
            double num2 = ((y – dts[index]) / (dts[index + 5] – dts[index])) * 10.0;
            double num3 = num2 * num2;
            double num4 = num3 * num2;
            return (((dts[index + 1] + (dts[index + 2] * num2)) + (dts[index + 3] * num3)) + (dts[index + 4] * num4));
        }

        private double deltatT2(double jd)
        {
            return (this.deltatT((jd / 365.2425) + 2000.0) / 86400.0);
        }

        private double Dint_dec(double jd, double shiqu, bool int_dec)
        {
            double d = ((jd + 0.5) – this.deltatT2(jd)) + (shiqu / 24.0);
            if (int_dec)
            {
                return Math.Floor(d);
            }
            return (d – Math.Floor(d));
        }

        public double[] earCal(double jd)
        {
            this.EnnT = jd / 365250.0;
            double[] numArray = new double[3];
            double ennT = this.EnnT;
            double num2 = ennT * ennT;
            double num3 = num2 * ennT;
            double num4 = num3 * ennT;
            double num5 = num4 * ennT;
            numArray[0] = ((((this.Enn(E10) + (this.Enn(this.E11) * ennT)) + (this.Enn(this.E12) * num2)) + (this.Enn(this.E13) * num3)) + (this.Enn(this.E14) * num4)) + (this.Enn(this.E15) * num5);
            numArray[1] = this.Enn(this.E20) + (this.Enn(this.E21) * ennT);
            numArray[2] = ((this.Enn(this.E30) + (this.Enn(this.E31) * ennT)) + (this.Enn(this.E32) * num2)) + (this.Enn(this.E33) * num3);
            numArray[0] = this.rad2mrad(numArray[0]);
            return numArray;
        }

        private double Enn(double[] E)
        {
            double num = 0.0;
            for (int i = 0; i < E.Length; i += 3)
            {
                num += E[i] * Math.Cos(E[i + 1] + (this.EnnT * E[i + 2]));
            }
            return num;
        }

        public 公历时间 GetDate()
        {
            return new 公历时间((int) this.Y, (int) this.M, (int) this.D, (int) this.h, (int) this.m, (int) this.s);
        }

        public 公历时间 GetDateFromJD2000(double jd)
        {
            jd += 2451545.5;
            double num = this.int2(jd);
            double v = jd – num;
            if (num > 2299161.0)
            {
                double num3 = this.int2((num – 1867216.25) / 36524.25);
                num += (1.0 + num3) – this.int2(num3 / 4.0);
            }
            num += 1524.0;
            double num4 = this.int2((num – 122.1) / 365.25);
            double num5 = num – this.int2(365.25 * num4);
            double num6 = this.int2(num5 / 30.6001);
            num5 -= this.int2(num6 * 30.6001);
            num4 -= 4716.0;
            num6–;
            if (num6 > 12.0)
            {
                num6 -= 12.0;
            }
            if (num6 <= 2.0)
            {
                num4++;
            }
            v *= 24.0;
            double num7 = this.int2(v);
            v -= num7;
            v *= 60.0;
            double num8 = this.int2(v);
            v -= num8;
            v *= 60.0;
            double num9 = v;
            return new 公历时间((int) num4, (int) num6, (int) num5, (int) num7, (int) num8, (int) num9);
        }

        public double GetDays(double y, double m, double d, double hour, double min, double sec)
        {
            return (((((((((367.0 * y) – Math.Floor((double) ((7.0 * (y + Math.Floor((double) ((m + 9.0) / 12.0)))) / 4.0))) – Math.Floor((double) ((3.0 * (Math.Floor((double) ((y + ((m – 9.0) / 7.0)) / 100.0)) + 1.0)) / 4.0))) + Math.Floor((double) ((275.0 * m) / 9.0))) + d) + (hour / 24.0)) + ((min / 60.0) / 24.0)) + (((sec / 60.0) / 60.0) / 24.0)) + 1721028.5);
        }

        public 公历时间 GetSunChuDateTime(double jd, double lat, double lng)
        {
            double num = jd – this.J2000;
            double l = 0.0 – (((((int) lat) + (((lat % 1.0) * 100.0) / 60.0)) / 180.0) * 3.1415926535897931);
            double fa = ((((int) lng) + (((lng % 1.0) * 100.0) / 60.0)) / 180.0) * 3.1415926535897931;
            double num4 = this.SunSheng(num, l, fa, 0.33333333333333331);
            return this.GetDateFromJD2000(num4);
        }

        public 公历时间 GetSunChuDateTime(公历时间 dt, double lat, double lng)
        {
            return this.GetSunChuDateTime(dt.TotalDays, lat, lng);
        }

        private void HCconv(double[] JW, double E)
        {
            double a = this.rad2mrad(JW[0]);
            double num2 = JW[1];
            double num3 = Math.Sin(E);
            double num4 = Math.Cos(E);
            double d = (num4 * Math.Sin(num2)) + ((num3 * Math.Cos(num2)) * Math.Sin(a));
            double v = Math.Atan2((Math.Sin(a) * num4) – (Math.Tan(num2) * num3), Math.Cos(a));
            JW[0] = this.rad2mrad(v);
            JW[1] = Math.Asin(d);
        }

        private double hcjj1(double t)
        {
            double num = t / 36525.0;
            double num2 = num * num;
            double num3 = num2 * num;
            return ((((this.hcjjB[0] + (this.hcjjB[1] * num)) + (this.hcjjB[2] * num2)) + (this.hcjjB[3] * num3)) / this.rad);
        }

        private double int2(double v)
        {
            v = Math.Floor(v);
            if (v < 0.0)
            {
                return (v + 1.0);
            }
            return v;
        }

        private double jiaoCai(double lx, double t, double jiao)
        {
            double[] zb = this.earCal(t);
            zb[0] += 3.1415926535897931;
            zb[1] = -zb[1];
            this.addGxc(t, zb);
            if (lx == 0.0)
            {
                NongLi.customd customd = this.nutation(t);
                zb[0] += customd.Lon;
                return this.rad2mrad(jiao – zb[0]);
            }
            double[] numArray2 = this.moonCal(t);
            return this.rad2mrad(jiao – (numArray2[0] – zb[0]));
        }

        private double jiaoCal(double t1, double jiao, double lx)
        {
            double t = t1;
            double num2 = 0.0;
            if (lx == 0.0)
            {
                t += 360.0;
            }
            else
            {
                t += 25.0;
            }
            jiao *= 0.017453292519943295;
            double num4 = this.jiaoCai(lx, t1, jiao);
            double num5 = this.jiaoCai(lx, t, jiao);
            if (num4 < num5)
            {
                num5 -= 6.2831853071795862;
            }
            double num6 = 1.0;
            for (int i = 0; i < 10; i++)
            {
                double num7 = (num5 – num4) / (t – t1);
                if (Math.Abs(num7) > 1E-15)
                {
                    num6 = num7;
                }
                num2 = t1 – (num4 / num6);
                double num3 = this.jiaoCai(lx, num2, jiao);
                if (num3 > 1.0)
                {
                    num3 -= 6.2831853071795862;
                }
                if (Math.Abs(num3) < 1E-08)
                {
                    return num2;
                }
                t1 = t;
                num4 = num5;
                t = num2;
                num5 = num3;
            }
            return num2;
        }

        private double Mnn(double[] F)
        {
            double num2 = 0.0;
            double mnnT = this.MnnT;
            double num4 = mnnT * mnnT;
            double num5 = num4 * mnnT;
            double num6 = num5 * mnnT;
            for (int i = 0; i < F.Length; i += 6)
            {
                num2 += F[i] * Math.Sin((((F[i + 1] + (mnnT * F[i + 2])) + (num4 * F[i + 3])) + (num5 * F[i + 4])) + (num6 * F[i + 5]));
            }
            return num2;
        }

        private double[] moonCal(double jd)
        {
            this.MnnT = jd / 36525.0;
            double mnnT = this.MnnT;
            double num2 = mnnT * mnnT;
            double num3 = num2 * mnnT;
            double num4 = num3 * mnnT;
            double[] zb = new double[] { ((this.Mnn(this.M10) + (this.Mnn(this.M11) * mnnT)) + (this.Mnn(this.M12) * num2)) / this.rad, (this.Mnn(this.M20) + (this.Mnn(this.M21) * mnnT)) / this.rad, (this.Mnn(this.M30) + (this.Mnn(this.M31) * mnnT)) * 0.999999949827 };
            zb[0] = ((((zb[0] + this.M1n[0]) + (this.M1n[1] * mnnT)) + (this.M1n[2] * num2)) + (this.M1n[3] * num3)) + (this.M1n[4] * num4);
            zb[0] = this.rad2mrad(zb[0]);
            this.addPrece(jd, zb);
            return zb;
        }

        private double[] moonCal2(double jd)
        {
            double[] numArray = this.moonCal(jd);
            NongLi.customd customd = this.nutation(jd);
            numArray[0] = this.rad2mrad(numArray[0] + customd.Lon);
            return numArray;
        }

        private double[] moonCal3(double jd)
        {
            double[] jW = this.moonCal(jd);
            this.HCconv(jW, this.hcjj1(jd));
            this.nutationRaDec(jd, jW);
            return jW;
        }

        private customd nutation(double t)
        {
            NongLi.customd customd = new NongLi.customd {
                Lon = 0.0,
                obl = 0.0
            };
            t /= 36525.0;
            double num3 = t;
            double num4 = num3 * num3;
            double num5 = num4 * num3;
            double num6 = num5 * num3;
            for (int i = 0; i < this.nutB.Length; i += 9)
            {
                double a = (((this.nutB[i] + (this.nutB[i + 1] * num3)) + (this.nutB[i + 2] * num4)) + (this.nutB[i + 3] * num5)) + (this.nutB[i + 4] * num6);
                customd.Lon += (this.nutB[i + 5] + ((this.nutB[i + 6] * t) / 10.0)) * Math.Sin(a);
                customd.obl += (this.nutB[i + 7] + ((this.nutB[i + 8] * t) / 10.0)) * Math.Cos(a);
            }
            customd.Lon /= this.rad * 10000.0;
            customd.obl /= this.rad * 10000.0;
            return customd;
        }

        private void nutationRaDec(double t, double[] zb)
        {
            double d = zb[0];
            double a = zb[1];
            double num3 = this.hcjj1(t);
            double num4 = Math.Sin(num3);
            double num5 = Math.Cos(num3);
            NongLi.customd customd = this.nutation(t);
            double num6 = Math.Cos(d);
            double num7 = Math.Sin(d);
            double num8 = Math.Tan(a);
            zb[0] += ((num5 + ((num4 * num7) * num8)) * customd.Lon) – ((num6 * num8) * customd.obl);
            zb[1] += ((num4 * num6) * customd.Lon) + (num7 * customd.obl);
            zb[0] = this.rad2mrad(zb[0]);
        }

        public string paiYue(int y)
        {
            int num;
            double[] numArray = new double[14];
            double[] numArray2 = new double[14];
            double[] numArray3 = new double[14];
            double num2 = (365.24219879 * (y – 0x7d0)) – 50.0;
            for (num = 0; num < 14; num++)
            {
                numArray[num] = this.jiaoCal(num2 + (num * 30.4), (double) ((num * 30) – 90), 0.0);
                numArray2[num] = this.jiaoCal(num2 + (num * 30.4), (double) ((num * 30) – 0x69), 0.0);
            }
            double num3 = (numArray[0] + 1.0) – this.Dint_dec(numArray[0], 8.0, false);
            numArray3[0] = this.jiaoCal(num3, 0.0, 1.0);
            for (num = 1; num < 14; num++)
            {
                numArray3[num] = this.jiaoCal(numArray3[num – 1] + 25.0, 0.0, 1.0);
            }
            double[] numArray4 = new double[14];
            double[] numArray5 = new double[14];
            double[] numArray6 = new double[14];
            for (num = 0; num < 14; num++)
            {
                numArray4[num] = this.Dint_dec(numArray[num], 8.0, true);
                numArray5[num] = this.Dint_dec(numArray2[num], 8.0, true);
                numArray6[num] = this.Dint_dec(numArray3[num], 8.0, true);
            }
            double num4 = 12.0;
            double num5 = -1.0;
            int[] numArray7 = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0 };
            string[] strArray = new string[numArray7.Length];
            if (numArray6[12] <= numArray4[12])
            {
                numArray7[12] = 12;
                num4 = 13.0;
                num = 1;
                while (num < 13)
                {
                    if (numArray6[num] <= numArray4[num])
                    {
                        break;
                    }
                    num++;
                }
                num5 = num – 1;
                while (num < 13)
                {
                    numArray7[num – 1]–;
                    num++;
                }
            }
            num = 0;
            while (num < num4)
            {
                strArray[num] = this.yueMing[(numArray7[num] + 10) % 12];
                if (num == num5)
                {
                    string[] strArray2;
                    IntPtr ptr;
                    (strArray2 = strArray)[(int) (ptr = (IntPtr) num)] = strArray2[(int) ptr] + "闰";
                }
                else
                {
                    string[] strArray3;
                    IntPtr ptr2;
                    (strArray3 = strArray)[(int) (ptr2 = (IntPtr) num)] = strArray3[(int) ptr2] + "月";
                }
                if ((numArray6[num + 1] – numArray6[num]) > 29.0)
                {
                    string[] strArray4;
                    IntPtr ptr3;
                    (strArray4 = strArray)[(int) (ptr3 = (IntPtr) num)] = strArray4[(int) ptr3] + "大";
                }
                else
                {
                    string[] strArray5;
                    IntPtr ptr4;
                    (strArray5 = strArray)[(int) (ptr4 = (IntPtr) num)] = strArray5[(int) ptr4] + "小";
                }
                num++;
            }
            string str = "节气    手表时            中气    手表时            农历月   朔的手表时\r\n";
            for (num = 0; num < num4; num++)
            {
                int index = ((num * 2) + 0x12) % 0x18;
                int num7 = ((num * 2) + 0x11) % 0x18;
                this.setFromJD((numArray2[num] + this.J2000) + 0.33333333333333331, true);
                string str2 = str;
                str = str2 + this.jqB[num7] + ":" + this.toStr() + " ";
                this.setFromJD((numArray[num] + this.J2000) + 0.33333333333333331, true);
                string str3 = str;
                str = str3 + this.jqB[index] + ":" + this.toStr() + " ";
                this.setFromJD((numArray3[num] + this.J2000) + 0.33333333333333331, true);
                string str4 = str;
                str = str4 + strArray[num] + ":" + this.toStr() + "\r\n";
            }
            Console.WriteLine(str);
            return str;
        }

        private double rad2mrad(double v)
        {
            v = v % 6.2831853071795862;
            if (v < 0.0)
            {
                return (v + 6.2831853071795862);
            }
            if (v > 3.1415926535897931)
            {
                return (v – 6.2831853071795862);
            }
            return v;
        }

        public void setFromJD(double jd, bool UTC)
        {
            double num3;
            if (UTC)
            {
                jd -= this.deltatT2(jd – this.J2000);
            }
            jd += 0.5;
            double num = this.int2(jd);
            double v = jd – num;
            if (num > 2299161.0)
            {
                num3 = this.int2((num – 1867216.25) / 36524.25);
                num += (1.0 + num3) – this.int2(num3 / 4.0);
            }
            num += 1524.0;
            this.Y = this.int2((num – 122.1) / 365.25);
            num3 = num – this.int2(365.25 * this.Y);
            this.M = this.int2(num3 / 30.6001);
            this.D = num3 – this.int2(this.M * 30.6001);
            this.Y -= 4716.0;
            this.M–;
            if (this.M > 12.0)
            {
                this.M -= 12.0;
            }
            if (this.M <= 2.0)
            {
                this.Y++;
            }
            v *= 24.0;
            this.h = this.int2(v);
            v -= this.h;
            v *= 60.0;
            this.m = this.int2(v);
            v -= this.m;
            v *= 60.0;
            this.s = v;
        }

        public double[] sunCal2(double jd)
        {
            double[] zb = this.earCal(jd);
            zb[0] += 3.1415926535897931;
            zb[1] = -zb[1];
            NongLi.customd customd = this.nutation(jd);
            zb[0] = this.rad2mrad(zb[0] + customd.Lon);
            this.addGxc(jd, zb);
            return zb;
        }

        private double sunLat(double t)
        {
            t += ((((32.0 * (t + 1.8)) * (t + 1.8)) – 20.0) / 86400.0) / 36525.0;
            double num = (((((48950621.66 + (6283319653.318 * t)) + ((53.0 * t) * t)) – 994.0) + (334166.0 * Math.Cos(4.669257 + (628.307585 * t)))) + (3489.0 * Math.Cos(4.6261 + (1256.61517 * t)))) + ((2060.6 * Math.Cos(2.67823 + (628.307585 * t))) * t);
            return (num / 10000000.0);
        }

        private double SunSheng(double jd, double L, double fa, double TZ)
        {
            jd -= TZ;
            double t = jd / 36525.0;
            double a = this.sunLat(t);
            double num3 = Math.Sin(a);
            double x = Math.Cos(a);
            double num5 = (6.2831853071795862 * (0.779057273264 + (1.0027378119113546 * jd))) + (((0.014506 + (4612.15739966 * t)) + ((1.39667721 * t) * t)) / this.rad);
            double d = (84381.406 – (46.836769 * t)) / this.rad;
            double num7 = Math.Atan2(num3 * Math.Cos(d), x);
            double num8 = Math.Asin(Math.Sin(d) * num3);
            double num9 = (Math.Sin(-3000.0 / this.rad) – (Math.Sin(fa) * Math.Sin(num8))) / (Math.Cos(fa) * Math.Cos(num8));
            if ((num9 >= 1.0) || (num9 <= -1.0))
            {
                return 0.0;
            }
            double num10 = -Math.Acos(num9);
            double num11 = (num5 – L) – num7;
            return ((jd – (this.rad2mrad(num11 – num10) / 6.28)) + TZ);
        }

        private double toJD(bool UTC)
        {
            double y = this.Y;
            double m = this.M;
            double num3 = 0.0;
            if (m <= 2.0)
            {
                m += 12.0;
                y–;
            }
            if ((((this.Y * 372.0) + (this.M * 31.0)) + this.D) >= 588829.0)
            {
                num3 = this.int2(y / 100.0);
                num3 = (2.0 – num3) + this.int2(num3 / 4.0);
            }
            num3 += this.int2(365.2500001 * (y + 4716.0));
            num3 += this.int2(30.6 * (m + 1.0)) + this.D;
            num3 += (((((this.s / 60.0) + this.m) / 60.0) + this.h) / 24.0) – 1524.5;
            if (UTC)
            {
                return (num3 + this.deltatT2(num3 – this.J2000));
            }
            return num3;
        }

        private string toStr()
        {
            string str = "     " + this.Y;
            string str2 = "0" + this.M;
            string str3 = "0" + this.D;
            string str4 = this.h.ToString();
            string str5 = this.m.ToString();
            string str6 = Math.Floor((double) (this.s + 0.5)).ToString();
            if (this.s >= 60.0)
            {
                this.s -= 60.0;
                this.m++;
            }
            if (this.m >= 60.0)
            {
                this.m -= 60.0;
                this.h++;
            }
            str4 = "0" + str4;
            str5 = "0" + str5;
            str6 = "0" + str6;
            str = str.Substring(str.Length – 5, 5);
            str2 = str2.Substring(str2.Length – 2, 2);
            str3 = str3.Substring(str3.Length – 2, 2);
            str4 = str4.Substring(str4.Length – 2, 2);
            str5 = str5.Substring(str5.Length – 2, 2);
            str6 = str6.Substring(str6.Length – 2, 2);
            return (str + "-" + str2 + "-" + str3 + " " + str4 + ":" + str5 + ":" + str6);
        }

        public double 罗睺(double jd)
        {
            double num = (jd – 2451545.0) / 36525.0;
            double num2 = num * num;
            double num3 = num * num2;
            double num4 = ((125.04452 – (1934.136261 * num)) + (0.0020708 * num2)) + (num3 / 450000.0);
            return (num4 * this.DegToRad);
        }

        public double 月孛(double jd)
        {
            return ((263.2976 + ((360.0 * (jd – 2451543.5)) / 3230.9375)) % 360.0);
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct customd
        {
            public double Lon;
            public double obl;
        }
}

《公布以前的计算核心》有1个想法

发表评论

电子邮件地址不会被公开。 必填项已用*标注