Sunrise and Sunset

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,

Gary

:sign0085:
 

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.
 

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?
 

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.
 
Top