Objective-C 天文学库

发布于 2024-08-23 08:29:25 字数 56 浏览 8 评论 0原文

我需要做一些月出方位角和时间计算。谁能推荐一个好的天文学库,最好是 Objective-C 的库?

I need to do some moonrise azimuth and time calculations. Can anyone recommend a good astronomy library, preferably in Objective-C?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

生死何惧 2024-08-30 08:29:25

我推荐 PJ Naughter 的 AA+ 库。它基于 Meeus 的《天文算法》一书。该库非常全面,用 C++ 编写(可以轻松地从 Objective-C 调用)。我的 iOS 应用 Lúan 使用此库。

I recommend PJ Naughter's AA+ library. It is based on the Astronomical Algorithms book by Meeus. The library is quite comprehensive and written in C++ (easily called from Objective-C). My iOS app Lúan uses this library.

再见回来 2024-08-30 08:29:25

也许开源项目的代码适合您?最近在 FLOSS-Weekly 上进行了关于 Stellarium

免责声明:我没有查看 Stellarium 的源代码,所以我不知道它是否有用,不幸的是它是用 C/C++ 编写的。

Maybe code of opensource projects could fit you? Recently on FLOSS-Weekly was a discussion about Stellarium.

Disclaimer: I didn't look at that source of Stellarium so I have no idea if it is useful at all and unfortunately it is written in C/C++.

爱格式化 2024-08-30 08:29:25

它不在 Objective C 中,但 pyephem 包中包含的库非常好。 C 源文件取自旧的 X windows xephem 程序,并添加了胶水以使这些函数可以在 Python 中使用。只要您不需要超高精度,这些例程可能就适合您。

http://rhodesmill.org/pyephem/

Its not in objective C but the library included in the pyephem package is quite good. The C source files were taken from the old X windows xephem program with glue added to make the functions available from within Python. As long as you don't require super-high accuracy, these routines will probably work for you.

http://rhodesmill.org/pyephem/

小草泠泠 2024-08-30 08:29:25

对于那些仍然对 2016 年感兴趣的人,我围绕 PJ Naughter 的 AA+ 库制作了 Objective-C(++) 和 Swift 包装器。它基于 Jean Meeus 的《天文算法》一书,并在 GitHub 上开源:

https://github。 com/onekiloparsec/SwiftAA

For those still interested in 2016, I've made an Objective-C(++) and Swift wrapper around PJ Naughter's AA+ library. It is based on the Astronomical Algorithms book by Jean Meeus and it is open-source on GitHub:

https://github.com/onekiloparsec/SwiftAA

一曲爱恨情仇 2024-08-30 08:29:25

有一个名为 Astrolog 的旧 C 库,它可能可以完成您所要求的一些操作。您可以在这里查看:http://www.astrolog.org/astrolog.htm

There's an old C library called Astrolog that can probably do some of the stuff you're asking. You can check it out here: http://www.astrolog.org/astrolog.htm

夜访吸血鬼 2024-08-30 08:29:25

除了 Andrew Hammond 的回答之外,我只是使用 Xcode 下载 AA。然后,我删除所有测试文件(AATest.cpp AATest.sin AATest.vcproj),并在 nYear / 100 的最后一行中发出 Xcode 的警告“隐式转换损失整数精度‘long’到‘int’”

CAAEasterDetails CAAEaster::Calculate(long nYear, bool GregorianCalendar)
{
  CAAEasterDetails details;

  if (GregorianCalendar)
  {                      
    int a = nYear % 19;
    int b = nYear / 100;

程序编译好的。仅当程序是 Objective C 时才编译,但如果程序是基于 Swift 则不编译。预处理器宏 AAPLUS_EXT_CLASS 出现问题。

On top of Andrew Hammond answer, I just use Xcode to download the AA. I then remove all the Test files (AATest.cpp AATest.sin AATest.vcproj) and with a warning by Xcode of "Implicit conversion loss integer precision 'long' to 'int'" in the last line on nYear / 100

CAAEasterDetails CAAEaster::Calculate(long nYear, bool GregorianCalendar)
{
  CAAEasterDetails details;

  if (GregorianCalendar)
  {                      
    int a = nYear % 19;
    int b = nYear / 100;

The program compile ok. Only compile if the program is objective c but not if it is Swift based. Got a problem with pre-processor macro AAPLUS_EXT_CLASS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文