Changeset View
Changeset View
Standalone View
Standalone View
colorcorrection/suncalc.cpp
Show All 27 Lines | |||||
28 | 28 | | |||
29 | #define TWILIGHT_NAUT -12.0 | 29 | #define TWILIGHT_NAUT -12.0 | ||
30 | #define TWILIGHT_CIVIL -6.0 | 30 | #define TWILIGHT_CIVIL -6.0 | ||
31 | #define SUN_RISE_SET -0.833 | 31 | #define SUN_RISE_SET -0.833 | ||
32 | #define SUN_HIGH 2.0 | 32 | #define SUN_HIGH 2.0 | ||
33 | 33 | | |||
34 | QPair<QTime, QTime> calculateSunTimings(QDate prompt, double latitude, double longitude, bool morning) | 34 | QPair<QTime, QTime> calculateSunTimings(QDate prompt, double latitude, double longitude, bool morning) | ||
35 | { | 35 | { | ||
36 | // calculations based on http://aa.quae.nl/en/reken/zonpositie.html | 36 | // calculations based on https://aa.quae.nl/en/reken/zonpositie.html | ||
37 | // accuracy: +/- 5min | 37 | // accuracy: +/- 5min | ||
38 | 38 | | |||
39 | // positioning | 39 | // positioning | ||
40 | const double rad = M_PI / 180.; | 40 | const double rad = M_PI / 180.; | ||
41 | const double earthObliquity = 23.4397; // epsilon | 41 | const double earthObliquity = 23.4397; // epsilon | ||
42 | 42 | | |||
43 | const double lat = latitude; // phi | 43 | const double lat = latitude; // phi | ||
44 | const double lng = -longitude; // lw | 44 | const double lng = -longitude; // lw | ||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |