MoonPosition
✖
MoonPosition
gives the position of the Moon for the specified date and location.
gives the positions of the Moon for all specified locations on the specified dates.
uses func to determine what to return for extended locations.
Details and Options



- MoonPosition returns the coordinates of the Moon on the celestial sphere as observed on any date from any location on Earth.
- MoonPosition[] makes use of $GeoLocation and $TimeZone to determine your location and time zone.
- The default form of the results is in the form {azimuth,altitude}.
- Locations can be specified as Entity objects, assuming they represent objects with geographic coordinates or GeoGraphics primitives, or they can be latitude/longitude pairs, assuming degrees as units.
- datespec can be a DateObject expression, a TimeObject expression, a date string or a {y,m,d,h,m,s} date list.
- datespec is assumed to be in $TimeZone, unless it is a DateObject or TimeObject expression with an explicit TimeZone option value.
- locationspec and datespec can be either individual items or lists of individual items.
- If datespec is a list of dates, then the results will contain TimeSeries objects.
- datespec can be specified as {start,end,increment} for compatibility with DateRange specifications.
- MoonPosition[…,func] is used to specify the format of output when locations are specified.
- Possible settings for func include:
-
Automatic returns intervals for extended locations only Interval returns intervals for all specified locations Mean returns mean value for extended locations Min returns minimum values for extended locations Max returns maximum values for extended locations StandardDeviation returns standard deviation for extended locations - MoonPosition[CelestialSystem->"Equatorial"] gives the right ascension and declination of the Moon.
- MoonPosition can accept the following options:
-
AltitudeMethod "ApparentAltitude" whether to take atmospheric refraction into account when computing altitude CelestialSystem "Horizon" whether to return azimuth/altitude or right ascension/declination - Possible settings for CelestialSystem include:
-
"Horizon" returns results as a pair of azimuth/altitude (az/alt) values "Equatorial" returns results as a pair of right ascension/declination ( /
) values
- Possible settings for AltitudeMethod include:
-
"ApparentAltitude" take atmospheric refraction into account for altitude computations "TrueAltitude" assume no atmospheric refraction for altitude computations

Examples
open allclose allBasic Examples (5)Summary of the most common use cases
Compute the current position of the Moon for your location:

https://wolfram.com/xid/0d6er9h0a6-etsbfd

Compute the position of the Moon for a specified date:

https://wolfram.com/xid/0d6er9h0a6-dans15

Compute the current position of the Moon for a specified location:

https://wolfram.com/xid/0d6er9h0a6-19a7o

Compute the position of the Moon for a specified latitude/longitude and date:

https://wolfram.com/xid/0d6er9h0a6-k5huuj

Compute the position of the Moon for a specified city and date:

https://wolfram.com/xid/0d6er9h0a6-bild8d

Scope (8)Survey of the scope of standard use cases
Dates (3)
Dates can be specified as a DateObject:

https://wolfram.com/xid/0d6er9h0a6-slp3xb

Dates can be specified as a date string:

https://wolfram.com/xid/0d6er9h0a6-zbahi

Generate the Moon's position for a range of dates:

https://wolfram.com/xid/0d6er9h0a6-glueuf

Locations (5)
Locations can be latitude/longitude pairs:

https://wolfram.com/xid/0d6er9h0a6-mmgexd

Cities are treated as single, specific locations:

https://wolfram.com/xid/0d6er9h0a6-gzg19x

Results for extended locations are intervals, by default:

https://wolfram.com/xid/0d6er9h0a6-dtmpwg

The form of the results for extended locations can be overridden:

https://wolfram.com/xid/0d6er9h0a6-i1bmkv

Find the Moon's position for multiple locations:

https://wolfram.com/xid/0d6er9h0a6-bkoy4c

Options (2)Common values & functionality for each option
CelestialSystem (1)
AltitudeMethod (1)
The default setting for AltitudeMethod simulates atmospheric refraction:

https://wolfram.com/xid/0d6er9h0a6-bb4dj

Allow for no atmospheric refraction when computing the altitude of the Moon:

https://wolfram.com/xid/0d6er9h0a6-dmkuu1

Applications (4)Sample problems that can be solved with this function
The Moon's orbit is tilted with respect to the Earth's equator:

https://wolfram.com/xid/0d6er9h0a6-gsnuda

Plot the angular distance between the Sun and Moon over a month:

https://wolfram.com/xid/0d6er9h0a6-b9odho

https://wolfram.com/xid/0d6er9h0a6-8lc3s

https://wolfram.com/xid/0d6er9h0a6-j33fj5

https://wolfram.com/xid/0d6er9h0a6-il47d

https://wolfram.com/xid/0d6er9h0a6-d9u6ck

Reconstruct the Moon's orbital period using the position of the Moon over several months:

https://wolfram.com/xid/0d6er9h0a6-bf0irw
Extract the positions where the Moon's right ascension suddenly goes from 24 hours to 0 hours and find the mean period where this transition happens:

https://wolfram.com/xid/0d6er9h0a6-f3kpab

Compare this to the actual value of the Moon's orbital period:

https://wolfram.com/xid/0d6er9h0a6-fvyqvy

Plot the position of the Sun and Moon on the celestial sphere:

https://wolfram.com/xid/0d6er9h0a6-brlq2l

https://wolfram.com/xid/0d6er9h0a6-b8wfwc

Properties & Relations (4)Properties of the function, and connections to other functions
By default, location is specified by $GeoLocation and the date is specified by the current date:

https://wolfram.com/xid/0d6er9h0a6-x72irg


https://wolfram.com/xid/0d6er9h0a6-cx7drs

Results are in the form of a TimeSeries when a range of dates is specified:

https://wolfram.com/xid/0d6er9h0a6-rfwbr

Results are multivalued for each date specification, so plotting the results using DateListPlot will result in two curves, one for azimuth and one for altitude:

https://wolfram.com/xid/0d6er9h0a6-e0amz4

Find the position of the Moon for this location and date:

https://wolfram.com/xid/0d6er9h0a6-cr53ju

https://wolfram.com/xid/0d6er9h0a6-cz6ds


https://wolfram.com/xid/0d6er9h0a6-ddpbff

This can also be computed with AstroPosition:

https://wolfram.com/xid/0d6er9h0a6-e4pl3e

Possible Issues (2)Common pitfalls and unexpected behavior
With MoonPosition[locationspec,Interval], results for specific locations are coerced into intervals:

https://wolfram.com/xid/0d6er9h0a6-ex0nzz

Attempting to plot the results of MoonPosition using "Minute" granularity or larger can result in artifacts:

https://wolfram.com/xid/0d6er9h0a6-twz7q

One workaround to such issues is to coerce the incoming date so that it has "Instant" granularity:

https://wolfram.com/xid/0d6er9h0a6-c97fup

Neat Examples (1)Surprising or curious use cases

https://wolfram.com/xid/0d6er9h0a6-i1rhz0
This is the sidereal time of that location at that time:

https://wolfram.com/xid/0d6er9h0a6-3elp6y

Take the right ascensions of the Sun, the Moon and the planets:

https://wolfram.com/xid/0d6er9h0a6-jt3gg0

Construct text labels for them:

https://wolfram.com/xid/0d6er9h0a6-1aoala
Plot the directions of the Sun, the Moon and the planets as viewed from the South Pole, with respect to the fixed stars:

https://wolfram.com/xid/0d6er9h0a6-iqh820

Wolfram Research (2014), MoonPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/MoonPosition.html (updated 2023).
Text
Wolfram Research (2014), MoonPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/MoonPosition.html (updated 2023).
Wolfram Research (2014), MoonPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/MoonPosition.html (updated 2023).
CMS
Wolfram Language. 2014. "MoonPosition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/MoonPosition.html.
Wolfram Language. 2014. "MoonPosition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/MoonPosition.html.
APA
Wolfram Language. (2014). MoonPosition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoonPosition.html
Wolfram Language. (2014). MoonPosition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoonPosition.html
BibTeX
@misc{reference.wolfram_2025_moonposition, author="Wolfram Research", title="{MoonPosition}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/MoonPosition.html}", note=[Accessed: 21-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_moonposition, organization={Wolfram Research}, title={MoonPosition}, year={2023}, url={https://reference.wolfram.com/language/ref/MoonPosition.html}, note=[Accessed: 21-April-2025
]}