Home > atmlab > geographical > sun_eclip.m

sun_eclip

PURPOSE ^

SUN_ECLIP Ecliptic coordinates of the Sun.

SYNOPSIS ^

function [L,ep,g] = sun_eclip(mjd)

DESCRIPTION ^

 SUN_ECLIP Ecliptic coordinates of the Sun.
   [l,ep,g] = sun_eclip(mjd) calculates the Sun's ecliptic longitude,
   obliquity of the ecliptic and mean anomaly, from the Astronomical
   Almanac (see Michalsky, 1988).  The angles are in radians.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

sun_eclip.m

SOURCE CODE ^

0001 function [L,ep,g] = sun_eclip(mjd)
0002 % SUN_ECLIP Ecliptic coordinates of the Sun.
0003 %   [l,ep,g] = sun_eclip(mjd) calculates the Sun's ecliptic longitude,
0004 %   obliquity of the ecliptic and mean anomaly, from the Astronomical
0005 %   Almanac (see Michalsky, 1988).  The angles are in radians.
0006 
0007 %----------------------------------------------------------------
0008 % Craig Haley 20/09/01
0009 %   30-06-04 CSH made small changes
0010 %   02-10-05 CSH vectorized
0011 %----------------------------------------------------------------
0012 
0013 DEGREE = pi/180.0;
0014 
0015 D = mjd-51544.5;
0016 
0017 %mean longitude between 0 and 360 degrees
0018 q = 280.459+0.98564736*D;
0019 q = mod(q,360.0);
0020 q(q < 0) = q(q < 0)+360;
0021 
0022 %mean anomaly in radians between 0 and 2*PI
0023 g = 357.529+0.98560028*D;
0024 g = mod(g,360.0);
0025 g(g < 0) = g(g < 0)+360;
0026 g = g*DEGREE;
0027 
0028 %ecliptic longitude in radians between 0 and 2*PI
0029 L = q+1.915*sin(g)+0.020*sin(2.0*g);
0030 L = mod(L,360.0);
0031 L(L < 0) = L(L < 0)+360;
0032 L = L*DEGREE;
0033 
0034 %obliquity of ecliptic in radians
0035 ep = 23.439-0.00000036*D;
0036 ep = ep*DEGREE;

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005