Giter Site home page Giter Site logo

Comments (5)

andris-zalitis avatar andris-zalitis commented on June 3, 2024

One option would be to remove:
let midnight = self.celestialBody.julianDay.midnight and just use JulianDate itself, but then we would loose the ability of running code that asks for moonrise/moonset for a local time with hours and minutes, without caring to convert it to local midnight.

Therefore I have opted to use localMidnight(timeZone:) to solve this. Note that although we already have localMidnight(longitude:) it does not fully solve the problem because there are differences between midnight calculated based on longitude vs midnight calculated based on time zone.

from swiftaa.

andris-zalitis avatar andris-zalitis commented on June 3, 2024

BTW I've used moonrise/moonset in the example because those change more rapidly from day to day than sunrise/sunset or dawn/dusk.

from swiftaa.

onekiloparsec avatar onekiloparsec commented on June 3, 2024

This is great again, thanks for checking this in details! Again, once we settle the discussion about midnight in #54, I'll happy to merge that work.

from swiftaa.

onekiloparsec avatar onekiloparsec commented on June 3, 2024

Quick note: this isn't settled yet, but I'm still on it. I have tracked down (and down and down...) the problem of rise transit and set times. And it seems, somehow, I don't get right the equatorial coordinates for the date. I'll be in vacations for some time, but I'll be back!

from swiftaa.

onekiloparsec avatar onekiloparsec commented on June 3, 2024

I found the root cause of our problems. I was computing equatorial coordinates of solar system objects based on ecliptic coordinates. But not "normal" (geocentric) ecliptic coordinates, rather the heliocentric ones! I didn't know those latter coords existed anyway.

I had to change a bit the CelestialBody protocol, and I managed to make all tests pass. However, some of them with an accuracy that is not satisfactory. I can't do more for now, as I am leaving for a few vacations. But I am relieved this important issue is solved.

from swiftaa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.