当前位置: 首页>>代码示例>>C#>>正文


C# SwissEph.swe_calc方法代码示例

本文整理汇总了C#中SwissEph.swe_calc方法的典型用法代码示例。如果您正苦于以下问题:C# SwissEph.swe_calc方法的具体用法?C# SwissEph.swe_calc怎么用?C# SwissEph.swe_calc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SwissEph的用法示例。


在下文中一共展示了SwissEph.swe_calc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test_swe_set_topo

        public void Test_swe_set_topo()
        {
            using (var swe = new SwissEph())
            {
                double tjd = swe.swe_julday(1974, 8, 16, 0.5, SwissEph.SE_GREG_CAL);
                double[] geopos = new double[] { 47.853333, 5.333889, 468 };
                double[] xin1 = new double[6],
                    xin2 = new double[6],
                    xin3 = new double[6]
                    ; String serr = null;

                swe.swe_calc(tjd, SwissEph.SE_SUN, 33024, xin1, ref serr);
                Assert.AreEqual(0, xin1[0], 0.0000000000001);
                Assert.AreEqual(0, xin1[1], 0.0000000000001);
                Assert.AreEqual(0, xin1[2], 0.0000000000001);

                swe.swe_set_topo(geopos[0], geopos[1], geopos[2]);
                swe.swe_calc(tjd, SwissEph.SE_SUN, 33024, xin2, ref serr);
                Assert.AreEqual(142.78180233188, xin2[0], 0.000000000001);
                Assert.AreEqual(6.06728560368863E-05, xin2[1], 0.000000000001);
                Assert.AreEqual(1.01269577772231, xin2[2], 0.000000000001);

                swe.swe_calc(tjd, SwissEph.SE_SUN, 33024, xin3, ref serr);
                Assert.AreEqual(142.78180233188, xin3[0], 0.000000000001);
                Assert.AreEqual(6.06728560368863E-05, xin3[1], 0.0000000000001);
                Assert.AreEqual(1.01269577772231, xin3[2], 0.0000000000001);
            }
        }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:28,代码来源:SwissEphTest.swe_set_topo.cs

示例2: Test_swe_azalt

 public void Test_swe_azalt()
 {
     using (var swe = new SwissEph()) {
         double tjd = swe.swe_julday(1974, 8, 16, 0.5, SwissEph.SE_GREG_CAL);
         double[] geopos = new double[] { 47.853333, 5.333889, 468 };
         double[] xin = new double[6], xaz = new double[6]; String serr = null;
         swe.swe_calc(tjd, SwissEph.SE_SUN, SwissEph.SEFLG_MOSEPH, xin, ref serr);
         swe.swe_azalt(tjd, SwissEph.SE_ECL2HOR, geopos, 0, 0, xin, xaz);
         Assert.AreEqual(249.642425229358, xaz[0], 0.000000001);
         Assert.AreEqual(-32.8340786097275, xaz[1], 0.0000000001);
         Assert.AreEqual(-32.8340786097275, xaz[2], 0.0000000001);
     }
 }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:13,代码来源:SwissEphTest.swe_azalt.cs

示例3: Test_swe_calc

 public void Test_swe_calc()
 {
     using (var swe = new SwissEph()) {
         double tjd = swe.swe_julday(1974, 8, 16, 0.5, SwissEph.SE_GREG_CAL);
         double[] geopos = new double[] { 47.853333, 5.333889, 468 };
         double[] xx = new double[6]; String serr = null;
         swe.swe_calc(tjd, SwissEph.SE_SUN, SwissEph.SEFLG_MOSEPH, xx, ref serr);
         Assert.AreEqual(142.779826288975, xx[0], 0.000000000001);
         Assert.AreEqual(-1.57665386141208E-05, xx[1], 0.0000000000001);
         Assert.AreEqual(1.01267253822512, xx[2], 0.0000000000001);
         Assert.AreEqual(0, xx[3], 0.0000000000001);
         Assert.AreEqual(0, xx[4], 0.0000000000001);
         Assert.AreEqual(0, xx[5], 0.0000000000001);
     }
 }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:15,代码来源:SwissEphTest.swe_calc.cs


注:本文中的SwissEph.swe_calc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。