Professional Documents
Culture Documents
1998
10
25
Output
Rising
Astronomical
Nautical
Civil
Sun
###
###
###
###
days to J2000
###
Setting
Altitude
###
-18
###
-12
###
-6
###
-0.833
Notes
The VBA function Sunrise(day, glat, glong, index, altitude) does all the work, and is
based on a simple iterative scheme explained in the Explanatory Supplement to the
Astronomical Ephemeris, sections 9.311 and 9.33.
This routine may not give sensible values above 60N or below -60N, and is only accurate
to a few minutes either way. Sun rise/set times are heavily dependent on local
horizons anyway.
Page 1
Unrolled
Sunrise unrolled
Spreadsheet version of iterative sunrise calculation
Year
Month
Day
days
centuries
Variables
L
G
lambda
E
obliquity
GHA
delta
cost
t
new ut
new ut hrs
new days
centuries
1998
10
25
#MACRO?
#MACRO?
Latitude
Longitude
time zone
Required alt
Rise or set
52.5
-1.9167
0
-0.833
1
iterations
1st
2nd
3rd
4th
5th
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
#MACRO? #MACRO? #MACRO? #MACRO? #MACRO?
Page 2
UT
Zone time
###
###
Unrolled
###
###
Page 3
sunrise no vba
1998
10
25
52.5
-1.9167
0
-0.833
1
Output
Event UT
6.843
Event zone time
6.843
Days since J2000
-433.5
Centuries
-0.01187
Notes
Set B11 to -18 for astronomical twilight,
and -12 for nautical twilight, -6 for civil twilight
Set B12 to -1 for setting events, or 1 for rising events
3.725631
5.071077
-0.031525
3.694105
0.069238
0.409096
-0.210313
-1.280761
0.253779
1.314211
1.791597
-0.011861
Page 4
3.725631
5.071077
-0.031525
3.694105
0.069238
0.409096
-0.210313
-1.280758
0.253779
1.314211
1.791597
-0.011861
sunrise no vba
ersion to radians
pt to full 16 digits for L
erious errors
Page 5