# Given my latitude/longitude & time, how can I get the angle between the sun & me?

• I

## Main Question or Discussion Point

If you had your longitude/latitude, and the time/date, how could I go about working out the angle between your normal and the sun?
At first I was doing a simplistic approach of assuming elliptical orbit in only two dimensions and that the earth is a perfect sphere,

Can I get a more accurate method /formula than this that can be evaluated in one step without any iterative methods?

Any help appreciated.

Related Astronomy and Astrophysics News on Phys.org
Tom.G
I did that for a computer simulation of Solar heating for buildings about 45 years ago, so the details are rather sparse. Here is what I recall.
• For the basic apparent position from the observer, I used the equations for a satellite position that I modified for a 1 yr. period.
• As per convention, the 'Zero' reference for calculation was local Solar Noon on the Spring Equinox
• The 23.5° axis tilt with a period of one year was combined with the observers Latitude
• Azimuth was calculated from local Sunrise to Sunset, (in the US, this data was available in Federal Government publications)
There was an additional small correction of several degrees that was needed. I never knew the reason, but it was an additional low amplitude sine wave phase shifted from the Equinox. That got the result close enough to published data to be useful.

The calculation was done by using the 'Day-of-the-Year' and converting that to 'Day-from-Equinox', then plugging that and the local time into the calculation.

I don't recall the overall accuracy obtained, but it satisfied the legal requirements to calculate the annual energy usage of buildings. If you are trying to aim a telescope you will need several more corrections. For Solar Panel positioning the above general approach would be more than adequate.

Have Fun!

Cheers,
Tom

p.s. What is the project this is for?

p.s. What is the project this is for?
Same thing as you actually lol, solar panels, except I need to calculate savings given the roof size and geographic location. Not for paid work, just need to know if they're worth the cost within the first year.
Each panel gives 425w at optimal efficiency, but wanted more accurate kwh per month.

Was hoping there was a formula for exact sun position, and that someone made a parametric equation of the shape of the earth so I could use that to get the normal vector, and then already have sun position relative to the earth. I never did astrophysics so was reeeallly hoping a pre-existing formula existed, only CS and 2 years of mechanics and basic quantum.

Tom.G
For one-time use that you need it is a LOT easier to let the Internet do it for you.

Try this search:

Or leave the "map" off of it for a wider search.

Anyhow, I would be surprised if you can get a 1-year payback.

Where are you located? Let us know what you find.

Cheers,
Tom

OmCheeto
Gold Member
There are probably lots of documents on the web which have the relevant equations.
I've been working with the following for a couple of hours: Solar Geometry

I believe this is a simplified version of the ultimate equation:
cos(θ)=sin(δ)sin(ϕ)cos(β)+sin(δ)cos(ϕ)sin(β)cos(γ)+cos(δ)cos(ϕ)cos(β)cos(ω)-cos(δ)sin(ϕ)sin(β)cos(γ)cos(ω)-cos(δ)sin(β)sin(γ)sin(ω) {3.11}​
[note: I replaced their AZS with γ{= gamma}. Mainly because a third site, Angular Symbols for Standard Solar Relations, used it.]​
Theta(θ) being the angle between the sun and the surface in question.

Thanks! I long suspected I lived in the wrong house for solar. That calculator says I'd still be in the hole $7000 after 20 years. jim mcnamara Mentor 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 sophiecentaur Science Advisor Gold Member Was hoping there was a formula for exact sun position, and that someone made a parametric equation . . . . etc. You do not need an 'exact' answer for this. The requirement for accuracy of this angle is very slack indeed. The patterns of sensitivity of solar panels are very broad and the maximum is very wide so pointing doesn't need to be very accurate at all - except to make you feel better, perhaps. It would be a different matter if you wanted to track the Sun with a narrow beam optical or radio telescope. There are so many unknowns in trying to predict the probable power output at any time. The local topography, for one, can have a great effect on local cloud cover and mist and you could only determine that by long term measurements (over many years) with comparative data about many other sites. If you want to estimate whether the project is really worth while the financial risk then the best answer wouldn't come from the physics but from the Market. I think you would need to compare the prices that people, locally have actually paid for their installations with any cost estimate you have been given. If that estimate is significantly well below the median value of what people have paid then go for it. Now that the Feed In Tarrif has dropped to the level of useless you are 'on your own' - worse still, you (and all the rest of us) are paying for the subsidy that all those early installations have been earning. What's needed is for governments to take the risk and provide a fair form of subsidy to make this sort of domestic project attractive. Climate change could be a massive factor too - probably in your favour. PAllen Science Advisor 2019 Award .... Thanks! I long suspected I lived in the wrong house for solar. That calculator says I'd still be in the hole$7000 after 20 years.
Yeah, same boat. My wife and I approached two different solar installers, one even did residential ground mounts, giving extra placement options. Both researched our location and using google earth told us emphatically forget it. Unless we were willing to completely chop down a big, old, oak grove covering the whole south third of our property (we live in the northern hemisphere), they wouldn't even talk to us further. As people across the street go solar (their oaks are north side of property), we grumble, grumble ...

sophiecentaur