# Calculate the Moon Position in a Local Coordinate Frame

by admin in on April 4, 2019

This algorithm will accept a Latitude, Longitude and Altitude location as well as a specific universal coordinated time. It will use this information and calculate the position of the moon in a local coordinate frame (az and alt aka az and el). LunarAzEl function will ingest a Universal Time, and specific site location on earth, it will then output the lunar Azimuth and Elevation angles relative to that site. Function form is: [Az h] = LunarAzEl(UTC,Lat,Lon,Alt).

Code Input Description:

• UTC (Coordinated Universal Time YYYY/MM/DD hh:mm:ss)
• Lat (Site Latitude in degrees -90:90 -> S(-) N(+))
• Lon (Site Longitude in degrees -180:180 W(-) E(+))
• Altitude of the site above sea level (km)

Code Output Description:

• Az (Azimuth location of the moon in degrees)
• El (Elevation location of the moon in degrees)

External Source References:

• Basics of Positional Astronomy and Ephemerides
http://jgiesen.de/elevazmoon/basics/index.htm
• Computing planetary positions – a tutorial with worked examples
http://stjarnhimlen.se/comp/tutorial.html

Verified output by comparison with the following source data:
http://aa.usno.navy.mil/data/docs/AltAz.php

The code accuracy is +/- .2 deg of any Lat. and Lon. for a given UTC. Example of using this code:
[Az El] = LunarAzEl(‘1991/05/19 13:00:00’,50,10,0) gives:

Az = 317.328877362675

El = -14.3572781085777

Figure 1 . Graphical explanation of angles that the code will find

Share Now!

#### Release Information

• Price
:

\$3.99

• Released
:

April 4, 2019

• Last Updated
:

May 29, 2019