stretchyboy / where-to-shoot

a node express app using ejs to display a leaftlet map
MIT License
0 stars 0 forks source link

current sun position - opposites #2

Open mr-eggleton opened 6 years ago

stretchyboy commented 6 years ago

var sunrisePos = SunCalc.getPosition(times.sunrise, 51.5, -0.1);

SunCalc.getPosition(/Date/ timeAndDate, /Number/ latitude, /Number/ longitude)

Returns an object with the following properties:

altitude: sun altitude above the horizon in radians, e.g. 0 at the horizon and PI/2 at the zenith (straight over your head)
azimuth: sun azimuth in radians (direction along the horizon, measured from south to west), e.g. 0 is south and Math.PI * 3/4 is northwest