summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-09-19 19:53:08 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-09-19 19:53:08 +0100
commite9c9d5a883e819e7799e630a883917ce4c69b41a (patch)
tree28b778f194e4304542617efe373a8d99a271ae6e /test
parentInitial commit of code for calculating sun position (diff)
downloadilt-e9c9d5a883e819e7799e630a883917ce4c69b41a.tar.bz2
ilt-e9c9d5a883e819e7799e630a883917ce4c69b41a.tar.xz
ilt-e9c9d5a883e819e7799e630a883917ce4c69b41a.zip
Add new mathematical constants to lib
Diffstat (limited to 'test')
-rw-r--r--test/test-environment.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/test/test-environment.cpp b/test/test-environment.cpp
index 7b758d1..0d02aa1 100644
--- a/test/test-environment.cpp
+++ b/test/test-environment.cpp
@@ -7,10 +7,6 @@
#include <config/types.h>
#include <maths.h>
-constexpr auto degreesToRads = pi / 180.F;
-constexpr auto dEarthMeanRadius = 6371.01F; // In km
-constexpr auto dAstronomicalUnit = 149597890.F; // In km
-
// Based on the C++ code published at https://www.psa.es/sdg/sunpos.htm
// Linked from https://www.pveducation.org/pvcdrom/properties-of-sunlight/suns-position-to-high-accuracy
Direction2D
@@ -74,7 +70,7 @@ getSunPos(const Direction2D position, const float timeOfYear2024)
udtSunCoordinates.x = udtSunCoordinates.x + two_pi;
}
// Parallax Correction
- const auto dParallax = (dEarthMeanRadius / dAstronomicalUnit) * sin(udtSunCoordinates.y);
+ const auto dParallax = (earthMeanRadius / astronomicalUnit) * sin(udtSunCoordinates.y);
udtSunCoordinates.y = half_pi - (udtSunCoordinates.y + dParallax);
return udtSunCoordinates;