The earth's axis is not fully vertical, but is tilted away from the vertical by an angle of 23.5 degrees, resulting in seasonal changes throughout the year. Because of this tilt, the planet gets varying solar radiation from various regions of the world at different times of the day and year.
If you reside in the tropic of cancer and go for a stroll in the afternoon on June 21 or 22, that is on the summer solstice, you will notice that the sun is exactly 90 degrees above your head. During this time, the sun is at its highest position in the sky and stays there for a longer amount of time, resulting in the longest day of the year.
If you reside in the tropic of Capricorn and go for a stroll in the afternoon on December 21 and 22, that is during the winter solstice, you will notice that the sun is exactly 90 degrees above your head. During this time, the sun is at its lowest position in the sky and stays in the sky for a shorter amount of time, resulting in the shortest day of the year.
And if you live near the equator and go on an afternoon stroll on March 20 or 21 or August 21 or 22, you will see that the sun is exactly 90 degrees above your head. Throughout this time, there is equal day and night.
When the northern hemisphere experiences summer (when the northern hemisphere is inclined toward the sun), the southern hemisphere experiences winter (when the southern hemisphere is tilted away from the sun), and vice versa. In other words, because the globe tilts 23.5 degrees, the northern hemisphere receives more sunlight during the year than the southern hemisphere. However, during the equinox, both the northern and southern hemispheres (all the portions facing the sun) get equal quantities of sunlight, resulting in neither hot nor cold weather and equal day and night.
To calculate sun angle, we first need to know the latitude of that area. For example, let's suppose my location's latitude is 70 degrees north. If it's equinox, all portions receive equal sun light and the sun is perfectly vertical at the equator; hence, sun angle = 90 -70 = 30 degrees.
If the summer solstice occurs, the sun is perfectly vertical in the tropic of cancer (23.5 degrees above the equator); so, sun angle = 30+23.5 = 53.5 degrees.
If it is the Winter Solstice, the sun is perfectly vertical at the tropic of Capricorn (23.5 degrees south of the equator); so, sun angle = 30-23.5 = 6.5 degrees.