From Jean Meeus's "Astronomical Algorithms," 1951, p. 89:
tan H = sin A / (cos A * cos f + tan h * cos f)
where H is hour angle, A is azimuth, f is latitude and h is altitude,
and H is obtained via the arctangent.
He further remarks, p. 90, that the quadrant of the arctangent is unknown
and that it can be obtained by using the ATN2 function, if available, or by
the techniques in his Chapter 1 concerning The Correct Quadrant.
I hope that this is helpful.
Gordon
At 02:54 PM 12/12/00 -0400, Steve Lelievre wrote:
I'm trying to convert an azimuth value into an hour-angle, and would
appreciate some help with the formula and with my algebra. Using
dcl=declination, lat=latitude, azi=azimuth,ha=hour-angle, I started with a
standard formula for azimuth given hour-angle:
tan(azi) = sin(ha)/(sin(lat)*cos(ha) + tan(dcl)*cos(lat))
After multiplying out and rearranging, I got:
sin(lat)*tan(azi)*cos(ha) - sin(ha) = -tan(azi)*tan(dcl)*cos(lat)
Substituting into a standard fromula from my old notes from school, this
solves as:
ha = arctan(-1 / sin(lat)*tan(azi)) + - arccos( -tan(azi)*tan(dcl)*cos(lat)
/ sqrt( sin(lat)^2 * tan(azi)^2 +1 ))
where + - means plus or minus
Questions:
Is this the correct solution?
If so, how should I interpret the plus or minus element of the solution.
Surely for any given azimuth-latitude-declination there is only one possible
hour-angle, not the two implied by the plus or minus option?
Many thanks, Steve
Gordon Uber [EMAIL PROTECTED] San Diego, California USA
Webmaster: Clocks and Time: http://www.ubr.com/clocks