Add a comment on cosH bounds

This commit is contained in:
Pim van Pelt
2019-10-03 08:57:30 +02:00
parent 2c0207b3eb
commit 03d6a36e0a

View File

@ -55,8 +55,11 @@ static float calcSun(int year, int month, int day, float latitude,
(cosDec * cos((M_PI / 180.0f) * latitude)); (cosDec * cos((M_PI / 180.0f) * latitude));
if (cosH > 1) { if (cosH > 1) {
// the sun never rises at this location on the specified date
return 0; return 0;
} else if (cosH < -1) { }
if (cosH < -1) {
// the sun never sets at this location on the specified date
return 0; return 0;
} }