suncalc
suncalc copied to clipboard
A tiny JavaScript library for calculating sun/moon positions and phases.
`SunCalc.getMoonIllumination = function (date) { var d = toDays(date || new Date()), s = sunCoords(d), m = moonCoords(d), sdist = 149598000, // distance from Earth to Sun in km phi...
An example given in the docs is the following: ```js // get today's sunlight times for London var times = SunCalc.getTimes(new Date(), 51.5, -0.1); ``` To me this suggests that...
Similar to #104, would be handy to have `height` (aka. altitude/elevation) added as an option to `getPosition` function and taken into account for returned object's values.
Formulas in https://github.com/maoserr/redshiftgui/blob/master/src/solar.c#L94 are more precise. We should look whether it's worth making suncalc calculations slightly more precise in expense of worse performance.
Using `getTimes` for some coordinates (close to a TZ border) and times close to but before midnight appears to produce an incorrect sunset time that is on the following day....
Hi there, The follow code gives me the wrong sunrise and sunset times for eastern Australia; Google tells me sunset is at 17:38 AEST (UTC+10). ``` getSunlightTimes(date = ymd("2023-09-15"), lat...
sir your equation to change radiant into azimuth needs a bit of change.. it doesn't fit with the app's result i use this one sunrisedata.azimu = 180 - (-1*(sunriseData.azimuth *...
Hello, in the documentation it is stated that sunPosition.azimuth is an angle in radians calculated from south to west. Therefore I assumed the values should be between 0 and 2*PI,...
I need to get the azimut and altitude angles not only at sunrise sunset but as a function over time. In the source code, I di not see this feature....
Adds support for platforms such as Google Apps Script and Cloudflare Workers