Objective-C Astronomy Library

假如想象 提交于 2019-12-03 06:27:22

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.

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++.

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/

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

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!