mourner / suncalc

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

Moon Illumination calculation with atan #131

Closed jason4short closed 5 years ago

jason4short commented 5 years ago

inc = Math.atan(sdist Math.sin(phi), m.dist - sdist Math.cos(phi))

Just curious why this calc is an atan with two arguments when atan only takes 1 argument. The second argument is ignored.

thanks Jason

mourner commented 5 years ago

https://github.com/mourner/suncalc/blob/master/suncalc.js#L16

jason4short commented 5 years ago

Ha, when I ported the code, I missed that. A little confusing since the compiler happily takes two values.