Code covered by the BSD License  

Highlights from
Moon Position

Be the first to rate this file! 22 Downloads (last 30 days) File Size: 18.14 KB File ID: #23475
image thumbnail

Moon Position

by James Tursa

 

30 Mar 2009 (Updated 01 Aug 2009)

moonpos calculates moon position accurate to 10 arcsec. Based on Astronomical Algorithms, Meeus

| Watch this File

File Information
Description

moonpos calculates the moon position using the method in the book
Astronomical Algorithms by Jean Meeus, Chapter 45, pp 307 - 313. The
algorithm used is accurate to about 10 arcsec in longitude and 4 arcsec
in latitude according to the book, although the time range is not
mentioned. The periodic terms used in this algorithm are based on the
Chapront ELP-2000/82 lunar theory, including the later improvements by
Chapront. The results of this theory are referred to the mean equinox
of date, but moonpos converts these to the apparent geocentric position
of the moon referred to the true equinox of date.
 
Syntax
 
B = moonpos(A)
B = moonpos(A,S1)
B = moonpos(A,S1,S2,...)
 
Description

A = a Nx1 double vector containing the date values. By default, the data
    is expected to be in Serial Date Number format, but this can be
    changed to Julian Day, Modified Julian Day, Reduced Julian Day, or
    Truncated Julian Dat with optional strings (see below).

  = a Nx6 double date matrix, where each row is a full date vector
    specifying year, month, day, hours, minutes, seconds in that order.
    Dates must be compatible with the MATLAB datenum function.

  = a Nx3 double date matrix, where each row is a partial date vector
    specifying year, month, and day in that order. Dates must be
    compatible with the MATLAB datenum function.

  = a NxM character array containing dates that are compatible with the
    datenum function.

    For the last three cases the datenum function is called automatically
    by moonpos to convert the dates to SDN format.

B = a NxM double vector containing the moon position data. By default a
    Nx3 vector is returned where the three columns are right ascension (rad),
    declination (rad), and distance (km), but this can be changed with
    optional strings (see below). Output is true-of-date from earth
    center.

Sn = Optional string argument(s) that alter input and output settings. You
     can specify more than one optional string. They are processed left to
     right and are case insensitive. If you specify mutually exclusive
     options (such as 'jd' and 'rjd'), the rightmost option will prevail.

     'julian' or 'julian day' or 'jd'
     = Input vector A is in Julian Day format. i.e., the interval of time
       in days and fractions of a day since January 1, 4713 BC Greenwich noon

     'reduced julian day' or 'reduced' or 'rjd'
     = Input vector A is in Reduced Julian Day format, RJD = JD - 2400000.

     'modified julian day' or 'modified' or 'mjd'
     = Input vector A is in Modified Julian Day format, MJD = JD - 2400000.5

     'truncated julian day' or 'truncated' or 'tjd'
     = Input vector A is in Truncated Julian Day format, TJD = JD - 2440000.5

     'radec'
     = Output is Nx3 matrix in right ascension, declination, distance format
       in units of radians, radians, kilometers (this is the default).
       But note that you can change the units of the angles or distance
       (see below), and you can add the x, y, z cartesian output at the
       same time with the 'xyz' option and get a Nx6 matrix result.

     'xyz'
     = Output is Nx3 matrix with x, y, z cartesian coordinates. Note
       that this can be specified in addition to 'radec' if you want
       a Nx6 matrix output with both data sets present. The order in
       which the 'radec' and 'xyz' options appear in the argument list
       determines the order in which the output appears in the result.

     'feet' or 'ft'
     = Output distances will be in feet instead of km.

     'meter' or 'meters' or 'm'
     = Output distances will be in meters instead of km.

     'degree' or 'degrees' or 'deg'
     = Output angles will be in degrees instead of radians.

     'hms'
     = Output right ascension will be in hh.mmsss... format.

     'dms'
     = Output declination will be in dd.mmsss... format.

     'nutationlow'
     = Use the slightly lower precision nutation formulae at the bottom
       of page 132 instead of the full TABLE 21.A terms.

Examples
  
Several examples are given in the included file moonpos_examples.m

MATLAB release MATLAB 7.4 (R2007a)
Other requirements Any C compiler, such as the built-in lcc compiler. (Compiling is automatic, you don't have to know anything about C).
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
01 Aug 2009

Added screenshot, BSD license.

Tag Activity for this File
Tag Applied By Date/Time
aerospace James Tursa 30 Mar 2009 14:29:57
moon James Tursa 30 Mar 2009 14:29:57
lunar James Tursa 30 Mar 2009 14:29:57
meeus James Tursa 30 Mar 2009 14:29:57
ephemeris James Tursa 30 Mar 2009 14:29:57
astronomy James Tursa 30 Mar 2009 14:29:57
astronomical James Tursa 30 Mar 2009 14:29:57
astronomical Michael 05 May 2009 16:35:07

Contact us at files@mathworks.com