<p>Well let's see:</p>

<h3>Local Standard Time Meridian (LSTM)</h3>

<p>The Local Standard Time Meridian (LSTM) is a reference meridian used for a particular time zone and is similar to the Prime Meridian, which is used for Greenwich Mean Time. 
The (LSTM) is calculated according to the equation:
$$
LSTM = 15^{o}.\Delta T_{GMT}
$$
where $\Delta T_{GMT}$ is the difference of the Local Time (LT) from Greenwich Mean Time (GMT) in hours.</p>

<h3>Equation of Time (EoT)</h3>

<p>The equation of time (EoT) (in minutes) is an empirical equation that corrects for the eccentricity of the Earth's orbit and the Earth's axial tilt.
$$
EoT = 9.87 sin\left(2B\right) - 7.53cos\left(B\right) - 1.5 sin\left(B\right)
$$</p>

<p>Where $B = \frac{360}{365}\left(d - 81\right) $ in degrees and d is the number of days since the start of the year.</p>

<h3>Time Correction Factor (TC)</h3>

<p>The net Time Correction Factor (in minutes) accounts for the variation of the Local Solar Time (LST) within a given time zone due to the longitude variations within the time zone and also incorporates the EoT above.
$$
TC = 4\left(Longitude - LSTM\right) + EoT
$$
The factor of 4 minutes comes from the fact that the Earth rotates 1° every 4 minutes.</p>

<h3>Local Solar Time (LST)</h3>

<p>The Local Solar Time (LST) can be found by using the previous two corrections to adjust the local time (LT).
$$
LST = LT + \frac{TC}{60}
$$</p>

<h3>Hour Angle (HRA)</h3>

<p>The Hour Angle converts the local solar time (LST) into the number of degrees which the sun moves across the sky. By definition, the Hour Angle is 0° at solar noon. Since the Earth rotates 15° per hour, each hour away from solar noon corresponds to an angular motion of the sun in the sky of 15°. In the morning the hour angle is negative, in the afternoon the hour angle is positive.
$$
HRA = 15^{o}\left(LST - 12\right)
$$</p>

<h3>Declination angle:</h3>

<p>The declination angle denoted by $\delta$, varies seasonally due to the tilt of the Earth on its axis of rotation and the rotation of the Earth around the sun. If the Earth were not tilted on its axis of rotation, the declination would always be 0°. However, the Earth is tilted by 23.45° and the declination angle varies plus or minus this amount. Only at the spring and fall equinoxes is the declination angle equal to 0°.
$$
\delta = 23.45^{o} sin\left[\frac{360}{365}\left(d - 81\right)\right]
$$</p>

<p>where <strong>d</strong> is the day of the year with Jan 1 as d = 1.</p>

<h3>Elevation angle:</h3>

<p>The elevation angle is the angular height of the sun in the sky measured from the horizontal. 
$$
α=sin^{−1}[sin\delta sin\phi + cos\delta cos\phi cos(HRA)]
$$
Where $\delta$ is the <strong>declination angle</strong>, $\phi$ is the <strong>local latitude</strong> and <em>HRA</em> is the <strong>Hour angle</strong>.</p>

<h1>Azimuth Angle:</h1>

<p>The azimuth angle is the compass direction from which the sunlight is coming. At solar noon, the sun is always directly south in the northern hemisphere and directly north in the southern hemisphere.
$$
Azimuth = cos^{-1}\left[\frac{sin\delta cos\phi - cos\delta sen\phi cos(HRA)}{cos\alpha}\right]
$$</p>

<p>Where $\delta$ is the <strong>declination angle</strong>, $\phi$ is the <strong>local latitude</strong> and <em>HRA</em> is the <strong>Hour angle</strong>.</p>

<h1>Zenith Angle:</h1>

<p>The zenith angle is the angle between the sun and the vertical. The zenith angle is similar to the elevation angle but it is measured from the vertical rather than from the horizontal, thus making the zenith
$$
Zenith = 90° - \alpha
$$</p>

<p>Where $\alpha$ is the <strong>elevation angle</strong>.</p>

<hr>

<p><em>Note</em> that your input parameters are going to be:</p>

<ul>
<li>Longitude</li>
<li>$\Delta T_{GMT}$ is the difference of the Local Time (LT) from Greenwich Mean Time (GMT) in hours</li>
<li><strong>LT</strong> local military time in hours</li>
<li>$\phi$ the <strong>local latitude</strong></li>
<li><strong>d</strong> the day of the year</li>
</ul>

CC BY-SA 3.0
2014-08-07T11:53:10.817Z
Thank you, this is exactly what I was looking for. A very clear and concise answer.
Max Woolf
CC BY-SA 3.0
2014-05-02T05:27:09.557Z
2014-05-02T06:27:09.053Z
2014-05-02T06:27:09.053Z
harogaston
<p>I'm not sure if this is relevant for you, but it was for me. This will calculate true elevation, but it will not be the same as what is observed due to atmospheric refraction. There is a Meeus solar calculator and that uses this to correct for that:
1.02 / (60 * tan((alpha + (10.3/(alpha + 5.11))) * pi/180))</p>

CC BY-SA 3.0
2017-08-30T15:52:39.317Z
2017-08-30T15:52:39.317Z
Kelsey
<p>How do I get the longitude/latitude from zenith/azimuth?</p>

<p>Or how can I position my sun in a 3d application? </p>

<p>code extracted from <a href="https://github.com/KlausBrunner/solarpositioning" rel="noreferrer">here</a></p>

<pre><code>public static AzimuthZenithAngle getSolarAzimuthZenithFromLatLon(float lat, float lon) {
   GregorianCalendar time = new GregorianCalendar(TimeZone.getDefault());
   return PSA.calculateSolarPosition(time, lat, lon);
}

public static Vector3 getSolarPosition(float radius, AzimuthZenithAngle az) {
    double a = az.getAzimuth();
    double z = az.getZenithAngle();

    float X  = (float) (radius*Math.sin(z)*Math.cos(a));
    float Y  = (float) (radius*Math.sin(z)*Math.sin(a));
    float Z  = (float) (radius*Math.cos(z));

    return new Vector3(X, Y, Z);
}
</code></pre>

<p>this is my code, but it's not working very well. </p>

CC BY-SA 3.0
2014-02-26T22:47:14.650Z
Is the observer at (0,0,0), or else radius large in comparison to the observer coordinates? Or could you specify, in which way the code behaves different from your expectation? The transformation from spherical coordinates to euclidean looks ok to me at first glance.
Gerald
CC BY-SA 3.0
2014-03-13T20:14:51.627Z
Do you mean altitude-azimuth? The zenith is a "fixed" point, not the current angle above the horizon of the sun
Jeremy
CC BY-SA 3.0
2014-03-13T20:28:42.520Z
I think you are asking two different questions. Determining the lat and long from zenith altitude and azimuth is one thing, plotting the position of the sun is another (and requires additional input parameters)
Jeremy
<the-sun>
How to get the longitude/latitude from solar zenith/azimuth?
lacas
# How to get the longitude/latitude from solar zenith/azimuth?

(Asked by: username_0 on 2014-02-26)

How do I get the longitude/latitude from zenith/azimuth?
Or how can I position my sun in a 3d application? 
code extracted from here
public static AzimuthZenithAngle getSolarAzimuthZenithFromLatLon(float lat, float lon) {
   GregorianCalendar time = new GregorianCalendar(TimeZone.getDefault());
   return PSA.calculateSolarPosition(time, lat, lon);
}

public static Vector3 getSolarPosition(float radius, AzimuthZenithAngle az) {
    double a = az.getAzimuth();
    double z = az.getZenithAngle();

    float X  = (float) (radius*Math.sin(z)*Math.cos(a));
    float Y  = (float) (radius*Math.sin(z)*Math.sin(a));
    float Z  = (float) (radius*Math.cos(z));

    return new Vector3(X, Y, Z);
}

this is my code, but it's not working very well.

**Tags:** the-sun

> **Comments:**
> **username_1**: Is the observer at (0,0,0), or else radius large in comparison to the observer coordinates? Or could you specify, in which way the code behaves different from your expectation? The transformation from spherical coordinates to euclidean looks ok to me at first glance.  
> **username_2**: Do you mean altitude-azimuth? The zenith is a "fixed" point, not the current angle above the horizon of the sun  
> **username_2**: I think you are asking two different questions. Determining the lat and long from zenith altitude and azimuth is one thing, plotting the position of the sun is another (and requires additional input parameters)  

---

## 2 answers

### Answer by username_3 on 2014-05-02. Score: 5

Well let's see:

### Local Standard Time Meridian (LSTM)

The Local Standard Time Meridian (LSTM) is a reference meridian used for a particular time zone and is similar to the Prime Meridian, which is used for Greenwich Mean Time.
The (LSTM) is calculated according to the equation:
$$
LSTM = 15^{o}.\Delta T\_{GMT}
$$
where $\Delta T\_{GMT}$ is the difference of the Local Time (LT) from Greenwich Mean Time (GMT) in hours.

### Equation of Time (EoT)

The equation of time (EoT) (in minutes) is an empirical equation that corrects for the eccentricity of the Earth's orbit and the Earth's axial tilt.
$$
EoT = 9.87 sin\left(2B\right) - 7.53cos\left(B\right) - 1.5 sin\left(B\right)
$$

Where $B = \frac{360}{365}\left(d - 81\right) $ in degrees and d is the number of days since the start of the year.

### Time Correction Factor (TC)

The net Time Correction Factor (in minutes) accounts for the variation of the Local Solar Time (LST) within a given time zone due to the longitude variations within the time zone and also incorporates the EoT above.
$$
TC = 4\left(Longitude - LSTM\right) + EoT
$$
The factor of 4 minutes comes from the fact that the Earth rotates 1° every 4 minutes.

### Local Solar Time (LST)

The Local Solar Time (LST) can be found by using the previous two corrections to adjust the local time (LT).
$$
LST = LT + \frac{TC}{60}
$$

### Hour Angle (HRA)

The Hour Angle converts the local solar time (LST) into the number of degrees which the sun moves across the sky. By definition, the Hour Angle is 0° at solar noon. Since the Earth rotates 15° per hour, each hour away from solar noon corresponds to an angular motion of the sun in the sky of 15°. In the morning the hour angle is negative, in the afternoon the hour angle is positive.
$$
HRA = 15^{o}\left(LST - 12\right)
$$

### Declination angle:

The declination angle denoted by $\delta$, varies seasonally due to the tilt of the Earth on its axis of rotation and the rotation of the Earth around the sun. If the Earth were not tilted on its axis of rotation, the declination would always be 0°. However, the Earth is tilted by 23.45° and the declination angle varies plus or minus this amount. Only at the spring and fall equinoxes is the declination angle equal to 0°.
$$
\delta = 23.45^{o} sin\left[\frac{360}{365}\left(d - 81\right)\right]
$$

where **d** is the day of the year with Jan 1 as d = 1.

### Elevation angle:

The elevation angle is the angular height of the sun in the sky measured from the horizontal.
$$
α=sin^{−1}[sin\delta sin\phi + cos\delta cos\phi cos(HRA)]
$$
Where $\delta$ is the **declination angle**, $\phi$ is the **local latitude** and *HRA* is the **Hour angle**.

# Azimuth Angle:

The azimuth angle is the compass direction from which the sunlight is coming. At solar noon, the sun is always directly south in the northern hemisphere and directly north in the southern hemisphere.
$$
Azimuth = cos^{-1}\left[\frac{sin\delta cos\phi - cos\delta sen\phi cos(HRA)}{cos\alpha}\right]
$$

Where $\delta$ is the **declination angle**, $\phi$ is the **local latitude** and *HRA* is the **Hour angle**.

# Zenith Angle:

The zenith angle is the angle between the sun and the vertical. The zenith angle is similar to the elevation angle but it is measured from the vertical rather than from the horizontal, thus making the zenith
$$
Zenith = 90° - \alpha
$$

Where $\alpha$ is the **elevation angle**.

---

*Note* that your input parameters are going to be:

* Longitude
* $\Delta T\_{GMT}$ is the difference of the Local Time (LT) from Greenwich Mean Time (GMT) in hours
* **LT** local military time in hours
* $\phi$ the **local latitude**
* **d** the day of the year

> **Comments:**
> **username_4**: Thank you, this is exactly what I was looking for. A very clear and concise answer.  

---

### Answer by username_5 on 2017-08-30. Score: 0

I'm not sure if this is relevant for you, but it was for me. This will calculate true elevation, but it will not be the same as what is observed due to atmospheric refraction. There is a Meeus solar calculator and that uses this to correct for that:
1.02 / (60 \* tan((alpha + (10.3/(alpha + 5.11))) \* pi/180))


---

