<p>To the precision that you need, you can calculate the azimuth A and altitude h of the Sun from the following equations:
$$
\tan(A) = \frac{\sin(H)}{\cos(H)\sin(\phi)-\tan(\delta)\cos(\phi)}\\
\sin(h)=\sin(\phi)\sin(\delta)+\cos(\phi)\cos(\delta)\cos(H)
$$
where</p>

<ul>
<li>A is the azimuth measured from due south (positive towards the west)</li>
<li>H is the hour angle which is the number of degrees before (negative angle) or after (positive) solar noon. Calculate this as 15*1.00274*(time of day - time of noon).</li>
<li>$\phi$ is the latitude (positive for northern hemisphere)</li>
<li>$\delta$ is the declination of the Sun. This can be calculated from the second equation by assuming the altitude of the Sun h=0 when it is rising or setting, and H=15*1.00274*time from sunrise to solar noon. The assumption here is that the time from solar noon to sunset is the same.</li>
<li>h is the altitude of the Sun above the horizon.</li>
</ul>

<p>All of the above quantities are in degrees. You may need to convert those to radians to perform the trigonometry calculations.</p>

<p>For a more accurate calculation, you would calculate the position of the Sun (its right ascension $\alpha$ and declination $\delta$) and Greenwich Mean Sidereal Time (GMST) based on the date and time throughout the day. Then using the latitude and longitude, you would calculate H, A, and h for various times of the day.</p>

CC BY-SA 4.0
2018-05-22T03:29:14.273Z
Those formulas make more sense if $H$ is the solar [hour angle](https://en.wikipedia.org/wiki/Hour_angle).
Mike G
CC BY-SA 4.0
2018-05-22T15:09:03.360Z
You're right! I put the description in the wrong location. Hopefully it makes more sense now. Thanks Mike G.
JohnHoltz
CC BY-SA 4.0
2018-05-22T15:33:13.750Z
That's better. The 1.00274 sidereal factor doesn't apply to the Sun though.
Mike G
CC BY-SA 4.0
2018-05-23T03:57:55.720Z
I agree that since the motion of the Sun (increasing in right ascension approximately 1 degree per day) is ignored in my approach, the factor of 1.00274 is entirely unnecessary. (Also, atmospheric refraction that causes sunrise to be earlier than "theoretical" and the Sun's diameter affects my calculation of the Sun's declination.) If this discussion were about a non-moving object on an airless planet, the factor of 1.00274 would be needed to convert delta clock time in hours to an angle (also in measured in hours, of right ascension), and then the factor of 15 converts that angle to degrees.
JohnHoltz
CC BY-SA 4.0
2018-05-22T03:18:21.497Z
2018-05-22T15:06:35.070Z
2018-05-22T15:06:35.070Z
JohnHoltz
<p>I'm trying to make a simple app for my own use to be able to check which of my favorit restaurants have outdoor seating sun and for how long etc.</p>

<p>Given the data in the title (sunrise, noon, sunset, longitude and latitude) I can draw a path where the sun should be at any given time, but I want to display the hight as well.</p>

<p>I live in sweden where the sun changes "hight angle" (sorry I don't know the exact term for it) which make the angle relevant when deciding on seatings amongst high buildings.
My end goal is to be able to use google maps 3D data to actually cast shadows on the map in a realistic way!</p>

<p>I have no Idea if I'm in the right place but I figure I'll give it a shot :)</p>

<the-sun><earth><orbital-elements><positional-astronomy><mathematics>
Given sunrise, noon, sunset, longitude and latitude can I calculate the "hight" or "ascension" of the sun?
Joel Broström
# Given sunrise, noon, sunset, longitude and latitude can I calculate the "hight" or "ascension" of the sun?

(Asked by: username_0 on 2018-05-21)

I'm trying to make a simple app for my own use to be able to check which of my favorit restaurants have outdoor seating sun and for how long etc.

Given the data in the title (sunrise, noon, sunset, longitude and latitude) I can draw a path where the sun should be at any given time, but I want to display the hight as well.

I live in sweden where the sun changes "hight angle" (sorry I don't know the exact term for it) which make the angle relevant when deciding on seatings amongst high buildings.
My end goal is to be able to use google maps 3D data to actually cast shadows on the map in a realistic way!

I have no Idea if I'm in the right place but I figure I'll give it a shot :)

**Tags:** the-sun, earth, orbital-elements, positional-astronomy, mathematics


---

## 1 answers

### Answer by username_1 on 2018-05-22. Score: 3 | Accepted answer

To the precision that you need, you can calculate the azimuth A and altitude h of the Sun from the following equations:
$$
\tan(A) = \frac{\sin(H)}{\cos(H)\sin(\phi)-\tan(\delta)\cos(\phi)}\\
\sin(h)=\sin(\phi)\sin(\delta)+\cos(\phi)\cos(\delta)\cos(H)
$$
where

* A is the azimuth measured from due south (positive towards the west)
* H is the hour angle which is the number of degrees before (negative angle) or after (positive) solar noon. Calculate this as 15\*1.00274\*(time of day - time of noon).
* $\phi$ is the latitude (positive for northern hemisphere)
* $\delta$ is the declination of the Sun. This can be calculated from the second equation by assuming the altitude of the Sun h=0 when it is rising or setting, and H=15\*1.00274\*time from sunrise to solar noon. The assumption here is that the time from solar noon to sunset is the same.
* h is the altitude of the Sun above the horizon.

All of the above quantities are in degrees. You may need to convert those to radians to perform the trigonometry calculations.

For a more accurate calculation, you would calculate the position of the Sun (its right ascension $\alpha$ and declination $\delta$) and Greenwich Mean Sidereal Time (GMST) based on the date and time throughout the day. Then using the latitude and longitude, you would calculate H, A, and h for various times of the day.

> **Comments:**
> **username_2**: Those formulas make more sense if $H$ is the solar [hour angle](https://en.wikipedia.org/wiki/Hour_angle).  
> **username_1**: You're right! I put the description in the wrong location. Hopefully it makes more sense now. Thanks username_2 G.  
> **username_2**: That's better. The 1.00274 sidereal factor doesn't apply to the Sun though.  
> **username_1**: I agree that since the motion of the Sun (increasing in right ascension approximately 1 degree per day) is ignored in my approach, the factor of 1.00274 is entirely unnecessary. (Also, atmospheric refraction that causes sunrise to be earlier than "theoretical" and the Sun's diameter affects my calculation of the Sun's declination.) If this discussion were about a non-moving object on an airless planet, the factor of 1.00274 would be needed to convert delta clock time in hours to an angle (also in measured in hours, of right ascension), and then the factor of 15 converts that angle to degrees.  

---

