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

RiseTransitSetTimes is broken #31

Closed alex-vasenin closed 7 years ago

alex-vasenin commented 7 years ago

RiseTransitSetTimes is broken because it uses CelestialBody.equatorialCoordinates which are heliocentric coordinates instead of geocentric coordinates (related to issue #24)

onekiloparsec commented 7 years ago

Interestingly, similar to the discussion we have in #25 I see .equatorialCoordinates as a true property of a CelestialBody. While the apparent geocentric ones needs an observer location to be computed.

Hence, one should add an .apparentEquatorialCoordinates(observerCoordinates:) function to CelestialBodies.

onekiloparsec commented 7 years ago

All wrong. The difference between heliocentric coordinates and geocentric ones, is computed by taking the mean obliquity of the ecliptic for the former, and the true one for the latter, thus taking into account aberration and nutation.