This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ==== SunPosition ==== Helper function to calculate the sun's position at a given time and position on the earth. === Description === <code>SunPosition( &Float:Elevation, &Float:Azimuth, Float:Lat, Float:Lng, time )</code> The function calculates the sun's position (Elevation & Azimuth) at the given lat/long coordinate at the given time. The function does not compensate for altitude, but assumes sea level. === Parameters === | ''Elevation'' | Variable to receive the result elevation in meters | | ''Azimuth'' | Variable to receive the result azimuth in degrees | | ''Lat'' | Latitude in degrees | | ''Lng'' | Longitude in degrees | | ''time'' | UTC time as seconds since epoch (unixtime) | If Lat/Lng and time are not submitted, the current GPS position and current time is assumed === Return value === The function does not return a value, but sets the Elevation and Azimuth variables. === Example usage === <code javascript> new Float:el; new Float:az; SunPosition( el, az, 38.67, -121.15, 1597439230 ); // Sun position in Folsom, CA on August 14 2020 @ 14:07 local time (21:07 UTC) // el = 62.2 degrees, az = 211.4 degrees (rounded) // Using GPS/current time as defaults, omitting location and time parameters: SunPosition( el, az ); </code> ezeio2/scriptref/sunposition.txt Last modified: 2022-03-03 20:31by andreh Log In