(date, lat, lng)
| 83 | |
| 84 | // calculates sun position for a given date and latitude/longitude |
| 85 | export function getPosition(date, lat, lng) { |
| 86 | const lw = rad * -lng; |
| 87 | const phi = rad * lat; |
| 88 | const d = toDays(date); |
| 89 | |
| 90 | const c = sunCoords(toDaysTT(d)); // position series run on Terrestrial Time |
| 91 | const H = siderealTime(d, lw) - c.ra; // sidereal time stays on UT |
| 92 | const h = altitude(H, phi, c.dec); |
| 93 | |
| 94 | return { |
| 95 | azimuth: azimuth(H, phi, c.dec), |
| 96 | // apparent (refraction-corrected) altitude in degrees |
| 97 | altitude: (h + astroRefraction(h)) / rad |
| 98 | }; |
| 99 | } |
| 100 | |
| 101 | // sun times configuration (angle, morning name, evening name) |
| 102 | export const times = [ |
nothing calls this directly
no test coverage detected
searching dependent graphs…