You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Sun object includes the function makeHorizontalCoordinates(with:)which is convenient for folks wanting to plot the location of the sun in the sky. The CelestialBody protocol already has all the information one needs to compute rectangular coordinates (RA and HA), so why not add a default implementation of the function to that protocol so all objects (not just the Sun) get access to it?
While I'm here, I'd just like to say that this library is AWESOME! It's already saved me tons of time and has taught me a lot about celestial coordinates as well. I'm looking forward to using it in my next app. Thanks!!!
The text was updated successfully, but these errors were encountered:
Hi. Thanks for your message. Indeed, this could be added.
I've spent so much time trying to factor out everything, and play with this powerful Swift pattern which is protocol-oriented programming. But sometimes, I missed a few details in the global view.
I am glad it helped you in different ways. Don't hesitate to support it on patreon, it if you wish. ;-)
I am currently moving the func makeHorizontalCoordinates(with geographicCoordinates: GeographicCoordinates) -> HorizontalCoordinates function from the Sun class to the CelestialBody protocol.
The little change is that it now uses self.equatorialCoordinates and not self.apparentEquatorialCoordinates as it was in the Sun class.
Hence to be consistent, I kept the method in the Sun class, with the existing implementation, but renaming it more correctly makeApparentHorizontalCoordinates(with geographicCoordinates: GeographicCoordinates) -> HorizontalCoordinates
Consequently: the Sun class has hence both methods: the standard one from the CelestialBodyprotocol, and the "apparent" one as a specific implementation.
A very small API suggestion...
The Sun object includes the function
makeHorizontalCoordinates(with:)
which is convenient for folks wanting to plot the location of the sun in the sky. The CelestialBody protocol already has all the information one needs to compute rectangular coordinates (RA and HA), so why not add a default implementation of the function to that protocol so all objects (not just the Sun) get access to it?While I'm here, I'd just like to say that this library is AWESOME! It's already saved me tons of time and has taught me a lot about celestial coordinates as well. I'm looking forward to using it in my next app. Thanks!!!
The text was updated successfully, but these errors were encountered: