Skip to content

Notes · Lab Notes

suncalc 2.x returns degrees, not radians

· javascript · astronomy

suncalc 1.x returned the sun's azimuth and altitude in radians, measured from the south. Version 2 switched to degrees, measured clockwise from north. Treating degrees as radians put the sun in the wrong place and made every shadow point the wrong way. A unit test that checks "10 a.m. sun is in the south-east" would have caught it on day one, so now I have one.