Home > matutils > angles > ael2hd.m

ael2hd

PURPOSE ^

-------------

SYNOPSIS ^

function [H,d] = ael2hd(az,el,lat)

DESCRIPTION ^

-------------
|  ae2hd.m  |
-------------

[H,d] = ael2hd(az,el,lat)

Takes the azimuth and elevation angles
of a source at a certain latitude, and returns
the hour angle and d. All angles are in degrees.


Inputs:
-------

az - azimuth of source, measured north through east.
el - the elevation of the source.
lat - latitude of the observer.

Outputs:
--------

H - hour angle of the source.
d - declination of the source.

History:
--------

04 Feb 2005 - Original by CHG (greer@oddjob.uchicago.edu)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [H,d] = ael2hd(az,el,lat)
0002 %-------------
0003 %|  ae2hd.m  |
0004 %-------------
0005 %
0006 %[H,d] = ael2hd(az,el,lat)
0007 %
0008 %Takes the azimuth and elevation angles
0009 %of a source at a certain latitude, and returns
0010 %the hour angle and d. All angles are in degrees.
0011 %
0012 %
0013 %Inputs:
0014 %-------
0015 %
0016 %az - azimuth of source, measured north through east.
0017 %el - the elevation of the source.
0018 %lat - latitude of the observer.
0019 %
0020 %Outputs:
0021 %--------
0022 %
0023 %H - hour angle of the source.
0024 %d - declination of the source.
0025 %
0026 %History:
0027 %--------
0028 %
0029 %04 Feb 2005 - Original by CHG (greer@oddjob.uchicago.edu)
0030 
0031 lat = pi * lat / 180.0;
0032 az  = pi * az / 180.0;
0033 el  = pi * el / 180.0;
0034 
0035 sL = sin(lat); cL = cos(lat);
0036 cE = cos(el);  sE = sin(el);
0037 cA = cos(az);  sA = sin(az);
0038 
0039 
0040 d = asin( sL.*sE + cL.*cE.*cA);
0041 
0042 cosH = ( (cL.*sE - sL.*cE.*cA)./cos(d) );
0043 sinH = (  -1.*cE.*sA./cos(d)  );
0044 
0045 H= atan2(sinH, cosH);
0046 
0047 d = d * 180.0 / pi;
0048 H = H * 180.0 / pi;
0049 
0050 
0051 
0052 
0053 
0054 return

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005