onekiloparsec / SwiftAA

The most comprehensive collection of accurate astronomical algorithms in (C++, Objective-C and) Swift.
http://www.onekiloparsec.dev/
MIT License
172 stars 31 forks source link

Swift use in an iOS App #43

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi there,

I'm looking for an algorithm witch give the sun position (Azimuth & Altitude) for a specific position at a specific date & hour. Your code looks very cool :) May be it can to the job ? Can you take a part of your time to help me found the right functions to use for my goal ?

Regards

onekiloparsec commented 7 years ago

Hi. Yes it does, you are in the right place.

Simply instantiate a Sun class with your date as JulianDay (there are easy constructors of JulianDay for that), then call the apparentEquatorialCoordinates() method, which gives you a EquatorialCoordinates instance. With that, you can call toHorizontalCoordinates(forGeographicalCoordinates:julianDay:) and that's it!

Note that pesky little detail that you have to provide again the same JulianDay value. I will have to add a HorizontalCoordinates method right into the Sun class soon.

ghost commented 7 years ago

Hi, thank you :]

My problem is to integrate your lib in an existing project.

ghost commented 7 years ago

? whats wrong ?

onekiloparsec commented 7 years ago

Wrong? Nothing. I thought I answered your question. As to integrate a lib in your project, it is a very classical problem, and I'm sure you can find a lot of help online already, no?