The answers you got have merit. But see the NOAA page link below (bottom) to check any results. It is waaay cool. I had to create an accurate program like what you want, once upon a time. Turned out to be really challenging, had to get outside help.
It is the solar position angle you want, I believe.
Jean Meeus discusses this in his book: 'Astronomical Algorithms', 1991
To start with, what you need to do:
You are looking for the sun declination angle:
http://mypages.iit.edu/~maslanka/SolarGeo.pdf
Has a nice explanation.
Next, Civil time correction:
You have to correct for the analemma - noon sun time is not the same as civil noon, almost every day of the year.
http://dfacaz.org/wp-content/QUIDNOVI/2007/02-03-2007/analemma.pdf
At this point you have a good sun noon declination angle, corrected for the equation of time.
If you actually get this far I can show you what JPL does to get the actual angle for any day time after all the corrections above. You need the Sun zenith angle, and other goodies.
...mmmm: No I Cannot right now. Ugh.
I cannot find it in my notes. It is part of calculating sunrise and sunset times for any lat/long between the arctic and antarctic circles for any day of the year. I got the FORTRAN code from NASA/JPL and it had some problems with accuracy as I recall. It does not seem to be out there anymore. Understandably. JPL has to track objects very carefully. Including the sun.
It was the code behind this page's predecessor:
https://www.esrl.noaa.gov/gmd/grad/solcalc/azel.html