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

Earth object lacks heliocentric coordinates property #29

Closed alex-vasenin closed 7 years ago

alex-vasenin commented 7 years ago

Subj

onekiloparsec commented 7 years ago

Could you be more precise: what type of heliocentric coordinates? Ecliptical heliocentric?

alex-vasenin commented 7 years ago

Yes, ecliptic heliocentric coordinates.

rodericj commented 7 years ago

@alex-vasenin I've made a quick change that might help out. Seems simple, but Earth didn't seem to inherit from Planet. ¯_(ツ)_/¯

onekiloparsec commented 7 years ago

If I remember well, that was intentional. Because Earth is a bit special in terms of planets... (no joke).

The general philosophy, when I started, was to have a protocol and its default implementation for every part of AA+, which follows more or less the chapters of the AA book. And then create meaningful objects inheriting from relevant protocols.

But today, I think the situation became too complex and unreadable. I plan to create a kind synthetic picture of the current situation about protocols and inheritance.

rodericj commented 7 years ago

Great. I look forward to it.

It sounds like you have it had a lot on your plate. Is your schedule lightening up or are you still off the clock for now?

onekiloparsec commented 7 years ago

Yes, I have a lot on my plate. But I'm back from vacations. :-) My schedule for night-projects is still very unpredictable. But SwiftAA is on top of my list (right below little-fire-that-must-be-extincted-asap).

onekiloparsec commented 7 years ago

As for this very specific problem of ecliptic heliocentric coordinates, the functions exist in (Obj-C)AA+ layers. And they were actually misleadingly used for computing times of rise, transit and set.

So it's only a matter of re-enabling them, for all planets, and for Earth in particular. But this question hits precisely the issue of difficult readability of APIs and protocol inheritance. I'll be happy to look at at asap once the little fire is extincted.

onekiloparsec commented 7 years ago

With the help of this great tool, I came up with this:

SwiftAAClassDiagram.pdf

Zoom on SolarSystem: SwiftAAClassDiagramSolarSystem.pdf

rodericj commented 7 years ago

Is there a way to vectorize those class diagrams? It's mostly text right? Feels like this should be possible.

onekiloparsec commented 7 years ago

It was easier than I think to add these coordinates for the Earth. The (Obj-)C++ functions exist, and they just needed to be added to the Swift class. Thus, fixed by 066b0002ea83416618da5a575e584ecd402390dc I close the issue.