The easiest way to check for daylight

Wishbone

Clueless developer
Addon Developer
Joined
Sep 12, 2010
Messages
2,420
Reaction score
2
Points
0
Location
Moscow
Okay, doing a new scenario challenge with Lua helpers. Want to check if targets are illuminated by sun (that is, I have global coords of the Sun, Earth and geodesic (lat/lon) coords of the site to check). From what I know from old books, I have to convert global coords to geocentric and then to topocentric cartesian and then to polar topocentric, and compare elevation with -50/60*RAD. Is there a shortcut in Orbiter API or should I do all the matrix stuff by myself? If the latter, would anyone please hint at any formulae that may help (dimly recall I would need local sidereal time).

TIA
 
Back
Top