Hi All,
I am attempting to calculate the Solar Azimuth in order to rotate a map towards the sun. For almost a week I have been researching the Web, found many, many references but still can't get any to give a valid result.
I have been using two online calculators that agree with each other as my bench mark none of formula I have found agree with these over the day.
1. Yes. I have corrected for day light savings
2. Most articles are written from a northern hemisphere perspective and are slipshop in mentioning if a southern hemisphere correction is needed.
3. Some formula assume an output of 0-360 degress clockwise from Nth. Some assume a +/- divergence from Nth or Sth depending on northern/southern hemisphere.
Has anyone actually used a method which consistently produces a valid result? Sorry if this sounds like I am asking for someone else to do the work but this "simple" task has turned in to something like bare handed eel fishing.
Below, not usable code but some of the formula:
Regards [Exasperated]
Roger
I am attempting to calculate the Solar Azimuth in order to rotate a map towards the sun. For almost a week I have been researching the Web, found many, many references but still can't get any to give a valid result.
I have been using two online calculators that agree with each other as my bench mark none of formula I have found agree with these over the day.
1. Yes. I have corrected for day light savings
2. Most articles are written from a northern hemisphere perspective and are slipshop in mentioning if a southern hemisphere correction is needed.
3. Some formula assume an output of 0-360 degress clockwise from Nth. Some assume a +/- divergence from Nth or Sth depending on northern/southern hemisphere.
Has anyone actually used a method which consistently produces a valid result? Sorry if this sounds like I am asking for someone else to do the work but this "simple" task has turned in to something like bare handed eel fishing.
Below, not usable code but some of the formula:
B4X:
a9 = (360/365.242199)*(NDay + 10)
b9 = a9 + 1.9136790357*SinD((360/365.242199)*(NDay-2)) '1.91... = 360 / cPI * 0.0167... ecc of earth
c9 = (a9 - ATanD(TanD(b9) / CosD(23.43755447))) / 180
EOT = 720 * (c9 - Round(c9))
Declination = -ASinD(SinD(23.44)*CosD(b9))
LSTM = 15*(Round(Longitude2/15))
SolarTime = DeciHour +(4*(Longitude1-LSTM))+ EOT 'Time of day in minutes
HourAngle = (SolarTime-720)/4 'Hour Angle in degrees
AltitudeAngle = ASinD(CosD(Abs(Latitude1))*CosD(Declination)*CosD(HourAngle)+SinD(Abs(Longitude1))*SinD(Declination))
'Azimuth = ACosD((SinD(AltitudeAngle)*SinD(Latitude1)-SinD(Declination))/(CosD(AltitudeAngle)*CosD(Latitude1)))
'Azimuth = ACosD(SinD(Declination)-(SinD(AltitudeAngle)*SinD(Latitude1))/(CosD(AltitudeAngle)*CosD(Latitude1)))
Private SZA As Double
'Now we can calculate the Sun Zenith Angle (SZA):
'Cos(SZA) = Sin(Latitude)*Sin(D)+Cos(Latitude)*Cos(D)*Cos(SHA)
'SZA = ACosD(SinD(Latitude1)*SinD(Declination)+CosD(Latitude1)*CosD(Declination)*Cos(HourAngle))
' Azimuth = ACosD((Sin(Declination)-SinD(Latitude1)*CosD(SZA))/(CosD(Latitude1)*Sin(SZA)))
SZA=90-AltitudeAngle
Azimuth = ACosD((SinD(Declination)*CosD(Latitude1)-CosD(HourAngle)*CosD(Declination)*SinD(Latitude1))/SinD(SZA))
Regards [Exasperated]
Roger