Sunrise and Sunset

Discussion in 'Questions (Windows Mobile)' started by willisgt, Nov 27, 2008.

  1. willisgt

    willisgt Active Member Licensed User

    I've been absent from this forum for a good while now, It's good to finally have a project lead me back here.

    I'm trying to calculate the time of sunrise and sunset for any given date. I have tried a couple of algorithms I found on the net, but none is producing the correct result.

    Has anyone else implemented this?

    Best Regards,


  2. N1c0_ds

    N1c0_ds Active Member Licensed User

  3. willisgt

    willisgt Active Member Licensed User

    Thanks for the link, it's one I hadn't found yet.

    Coding something like this isn't really a problem, it's just a lot of math. The problem I'm having is that the results are wrong - as in close, but substanitally different - from certifiably correct results for the same date, latitude and longitude.
  4. Mr_Gee

    Mr_Gee Active Member Licensed User

    As a workaround you could read a web page with the information..
    or does it need to be an "off-line" application?
  5. willisgt

    willisgt Active Member Licensed User

    I hadn't thought of reading the data off a web page, but you're right, that could probably be done.

    I'm told that there are tables out there somewhere with the data I need, but I can't seem to locate one. That would also probably do the job.

    Ideally, I'd like to make one of these algorithms work so I don't have to depend on tables or network access. I mean, this is just basic trigonometry, it shouldn't be this hard.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice