26 const T siteLatitudeRadians)
32 static_cast<T
>(0.4093) * std::sin(two_pi<T> * (julianDate -
static_cast<T
>(81)) /
static_cast<T
>(368));
34 const T sinDelta = std::sin(delta);
35 const T cosDelta = std::cos(delta);
36 const T sinLatitude = std::sin(siteLatitudeRadians);
37 const T cosLatitude = std::cos(siteLatitudeRadians);
39 const T angleTerm = pi<T> * solarTime24H /
static_cast<T
>(12);
40 const T sinAngleTerm = std::sin(angleTerm);
41 const T cosAngleTerm = std::cos(angleTerm);
43 const T sunPhiPreetham = std::atan((-cosDelta * sinAngleTerm) / (cosLatitude * sinDelta - sinLatitude * cosDelta * cosAngleTerm));
44 const T sunTheta = pi<T> /
static_cast<T
>(2) - std::asin(sinLatitude * sinDelta - cosLatitude * cosDelta * cosAngleTerm);
49 T sunPhi = -sunPhiPreetham +
static_cast<T
>(3 / 2) * pi<T>;
50 sunPhi = sunPhi > two_pi<T> ? sunPhi - two_pi<T> : sunPhi;
52 return {sunPhi, sunTheta};
TVector2< T > sun_sky_phi_theta(const T solarTime24H, const T julianDate, const T siteLatitudeRadians)
Locate spherical coordinates of the sun in sky.
Definition location.h:23