# HP Forums

Full Version: (11C) The Sun's Declination, Altitude, Azimuth
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The following program calculates three positions for our Sun in our Solar System:

1. Declination of the Sun (δ = 0° at the Equinoxes)
2. Altitude of the Sun (height of the sun)
3. Azimuth of the Sun (degree from latitude ground-wise north)

Formulas Used:

Inputs:
D = days after the vernal equinox (usually March 20 or March 21)
L = latitude given in D.MMSS format (avoid ±90°)
T = time before solar noon (12 PM). Example: 9 AM, T= 3. 3 PM, T = -3.

Declination:
δ = 23.45 * sin(D * 0.9856)

Altitude:
H = asin(cos L * cos D * cos(15 * T)) + sin L * sin D)

Azimuth:
A = acos((sin H * sin L - sin D) / (cos L * cos H))

Before running the program, store D in R1, L in R2, and T in R3.

Code:
```001 42, 21, 13  LBL C 002 43, 7  DEG 003 45, 1  RCL 1 004 48   . 005 9   9 006 8   8 007 5   5 008 6   6 009 20   × 010 23   SIN 011 2   2 012 3   3 013 48   . 014 4   4 015 5   5 016 20   × 017 44, 4  STO 4 018 31   R/S 019 24   COS 020 45, 2  RCL 2 021 43, 2  →H      022 24   COS 023 20   × 024 45, 3  RCL 3 025 1   1 026 5   5 027 20   × 028 24   COS 029 20   × 030 45, 2  RCL 2 031 43, 2  →H 032 23   SIN 033 45, 4  RCL 4 034 23   SIN 035 20   × 036 40   + 037 43, 23  ASIN 038 44, 5  STO 5 039 31   R/S 040 23   SIN 041 45, 2  RCL 2 042 43, 2  →H 043 23   SIN 044 20   × 045 45, 4  RCL 4 046 23   SIN 047 30   - 048 45, 2  RCL 2 049 43, 2  →H 050 24   COS 051 45, 5  RCL 5 052 24   COS 053 20   × 054 10   ÷ 055 43, 24  ACOS 056 44, 6  STO 6 057 43,32   RTN```

Example:
Stored Data:
R0 = 184 (approximately September 21),
R1 = -14° 50' 12" (entered as -14.5012)
R2 = 0 (noon)

Output:
δ ≈ 13.1576°
H ≈ 62.0058°
A = 180.0000°