Skip to content

C++ code to estimate Solar Azimuth and Elevation given GPS position and time without requiring access to a web service, original by Darin C. Koblick, ported to C++.

Notifications You must be signed in to change notification settings

kgodden/SolarAzEl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

SolarAzEl

C++ code to estimate Solar Azimuth and Elevation given GPS position and time without the need for access to any online/web services.

This can be handy if you're imaging outside and want to gauge the effect of changing sunight based on the position and time of day!

This code was originally written in Mathlab by Darin C.Koblick, this is a reasonably straight port to C++, vectorisation is not supported.

The repo consists of 1 .cpp file and 1 .h file, they define a function called SolarAzEl().

Example of using SolarAzEl().

double lat = 52.975;
double lon = -6.0494;
double altitude = 0;
 
double Az = 0.0;
double El = 0.0;
SolarAzEl(time(NULL), lat, lon, 0, &Az, &El);
 
printf("Azimuth: %f\n", Az);
printf("Elevation: %f\n", El);

About

C++ code to estimate Solar Azimuth and Elevation given GPS position and time without requiring access to a web service, original by Darin C. Koblick, ported to C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages