mourner / suncalc

A tiny JavaScript library for calculating sun/moon positions and phases.
BSD 2-Clause "Simplified" License
3.1k stars 415 forks source link

calculation error ? #3

Closed seriousme closed 11 years ago

seriousme commented 11 years ago

Hi,

I have tried the module using: SunCalc.getTimes(new Date(), 51.59,-4.77);

However the results for sunrise and sunset are approx 39 minutes off (later) than found on: http://www.timeanddate.com/worldclock/astronomy.html?n=1298 The longitude and lattitude in the function parameters match those of Dordrecht.

I've developed my own code in lua a few years ago based on some math that I found on the internet and that does (almost) match the results of timeanddate.com

Do you have any idea what I'm doing wrong ?

Kind regards,

Hans

mourner commented 11 years ago

You've put the wrong coordinates. 51.59,-4.77 is not a valid place (in somewhere in the sea by UK). 51.59,4.77 is though — it's Breda.

seriousme commented 11 years ago

Many thanks. Apologies for the inconvenience !

Vladimir Agafonkin notifications@github.comschreef:

You've put the wrong coordinates. 51.59,-4.77 is not a valid place (in somewhere in the sea by UK). 51.59,4.77 is though — it's Breda.

— Reply to this email directly or view it on GitHub.