<p>You can use a package such as the astropy or skyfield packages for python. It can calculate the position of any astronomical object.</p>
<p>You can use a website like <a href="https://suncalc.org" rel="nofollow noreferrer">suncalc.org</a> This lets you find the position of the sun at any time, and at any location.</p>
<p>However for the sun since it moves along the ecliptic, roughly at a uniform rate, you can approximate the position by doing coordinate transformations. The sun's longitude moves by 365.24/360 degrees a day from 0 at the vernal equinox and has an ecliptic latitude of 90 degrees. This can be converted into equatorial coordinates (right ascension and declension), and then, given the hour, the alt and az positions can be found. The formulae can all be found on <a href="https://en.wikipedia.org/wiki/Celestial_coordinate_system" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Celestial_coordinate_system</a></p>

CC BY-SA 4.0
2017-02-18T09:22:21.167Z
2024-01-06T11:39:54.720Z
2024-01-06T11:39:54.720Z
James K
<p>I was wondering how I could get the sun's azimuth and elevation values to shade a particular window with a roller shutter.</p>

<p>At first I thought azimuth is good enough; of course, it wasn't, as I found out in practice.
While there are calculators to find a and e for a specific location at a certain date, I lack the maths to figure out when the sun will hit a western window.</p>

<p>The window faces 270 deg, I know how far the eaves stick out, and the top and bottom edges of the window (and of course location).</p>

<p>I get the idea the maths will be complicated... however, (it won't matter much) as I want to program this into a controller to operate the shutter.</p>

<p>Any hints appreciated.</p>

<the-sun><azimuth>
Determine sun azimuth and elevation for shading a window throughout the year
MaxG
# Determine sun azimuth and elevation for shading a window throughout the year

(Asked by: username_0 on 2017-02-18)

I was wondering how I could get the sun's azimuth and elevation values to shade a particular window with a roller shutter.

At first I thought azimuth is good enough; of course, it wasn't, as I found out in practice.
While there are calculators to find a and e for a specific location at a certain date, I lack the maths to figure out when the sun will hit a western window.

The window faces 270 deg, I know how far the eaves stick out, and the top and bottom edges of the window (and of course location).

I get the idea the maths will be complicated... however, (it won't matter much) as I want to program this into a controller to operate the shutter.

Any hints appreciated.

**Tags:** the-sun, azimuth


---

## 1 answers

### Answer by username_1 on 2017-02-18. Score: 2 | Accepted answer

You can use a package such as the astropy or skyfield packages for python. It can calculate the position of any astronomical object.

You can use a website like [suncalc.org](https://suncalc.org) This lets you find the position of the sun at any time, and at any location.

However for the sun since it moves along the ecliptic, roughly at a uniform rate, you can approximate the position by doing coordinate transformations. The sun's longitude moves by 365.24/360 degrees a day from 0 at the vernal equinox and has an ecliptic latitude of 90 degrees. This can be converted into equatorial coordinates (right ascension and declension), and then, given the hour, the alt and az positions can be found. The formulae can all be found on <https://en.wikipedia.org/wiki/Celestial_coordinate_system>


---

