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


C# SwissEph.swe_jdet_to_utc方法代码示例

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


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

示例1: Test_swe_jdet_to_utc

        public void Test_swe_jdet_to_utc()
        {
            using (var swe = new SwissEph()) {
                int year = 0, month = 0, day = 0, hour = 0, min = 0; double sec = 0;

                swe.swe_jdet_to_utc(2442275.5213563, SwissEph.SE_GREG_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(1974, year);
                Assert.AreEqual(8, month);
                Assert.AreEqual(16, day);
                Assert.AreEqual(0, hour);
                Assert.AreEqual(30, min);
                Assert.AreEqual(0.000335276126861572, sec, 0.000000000000000001);

                swe.swe_jdet_to_utc(2442288.5213563, SwissEph.SE_JUL_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(1974, year);
                Assert.AreEqual(8, month);
                Assert.AreEqual(16, day);
                Assert.AreEqual(0, hour);
                Assert.AreEqual(30, min);
                Assert.AreEqual(0.000335276126861572, sec, 0.000000000000000001);

                // leap second
                swe.swe_jdet_to_utc(2442413.50052296, SwissEph.SE_GREG_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(1974, year);
                Assert.AreEqual(12, month);
                Assert.AreEqual(31, day);
                Assert.AreEqual(23, hour);
                Assert.AreEqual(59, min);
                Assert.AreEqual(59.9997586011887, sec, 0.00000000001);
                swe.swe_jdet_to_utc(2442413.50052299, SwissEph.SE_GREG_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(1974, year);
                Assert.AreEqual(12, month);
                Assert.AreEqual(31, day);
                Assert.AreEqual(23, hour);
                Assert.AreEqual(59, min);
                Assert.AreEqual(60.0022987127304, sec, 0.00000000001);
                swe.swe_jdet_to_utc(2442413.50055, SwissEph.SE_GREG_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(1975, year);
                Assert.AreEqual(1, month);
                Assert.AreEqual(1, day);
                Assert.AreEqual(0, hour);
                Assert.AreEqual(0, min);
                Assert.AreEqual(1.33598148822784, sec, 0.00000000001);

                // Before 1972
                swe.swe_jdet_to_utc(2437162.52122023, SwissEph.SE_GREG_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(1960, year);
                Assert.AreEqual(8, month);
                Assert.AreEqual(16, day);
                Assert.AreEqual(0, hour);
                Assert.AreEqual(29, min);
                Assert.AreEqual(59.9996513128281, sec, 0.000000000001);

                swe.swe_jdet_to_utc(2437175.52122041, SwissEph.SE_JUL_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(1960, year);
                Assert.AreEqual(8, month);
                Assert.AreEqual(16, day);
                Assert.AreEqual(0, hour);
                Assert.AreEqual(29, min);
                Assert.AreEqual(59.9996915459633, sec, 0.000000000001);

                // Date > today (after last leap date)
                swe.swe_jdet_to_utc(2462729.5218584, SwissEph.SE_GREG_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(2030, year);
                Assert.AreEqual(8, month);
                Assert.AreEqual(16, day);
                Assert.AreEqual(0, hour);
                Assert.AreEqual(30, min);
                Assert.AreEqual(0.441692769527435, sec, 0.000000000001);

                swe.swe_jdet_to_utc(2462742.52185908, SwissEph.SE_JUL_CAL, ref year, ref month, ref day, ref hour, ref min, ref sec);
                Assert.AreEqual(2030, year);
                Assert.AreEqual(8, month);
                Assert.AreEqual(16, day);
                Assert.AreEqual(0, hour);
                Assert.AreEqual(30, min);
                Assert.AreEqual(0.442135334014893, sec, 0.000000000001);

            }
        }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:80,代码来源:SwissEphTest.Date.cs


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