function SunDistance, JulianDate ; ; Return the apparent solar distance (AU) for the specified Julian Date(s). ; ; B. Knapp, 2000-12-01 ; ; Show usage? if n_params() eq 0 then begin print,' ' print,' SunDistance is a function which returns the apparent solar' print,' distance (AU) for the specified Julian Date(s).' print,' ' print,' d = SunDistance( JulianDate )' return,' ' endif ; ; "Low accuracy" (~0.01 degrees of longitude) algorithm of J. Meeus ; (Astronomical Algorithms, 2nd ed., 1998, pp 163-164). C=299792.458D0 AU=149597870.66D0 JC=36525.D0 AU2JC = AU/C/86400.D0/JC T = (JulianDate-2451545.0d0)/JC ; Iterate twice, to get apparent distance Tau = 0.d0 for i=1,2 do begin T = T-Tau L0 = 280.46646d0 + (36000.76983d0 + 0.0003032*T)*T M = 357.52911d0 + (35999.05029d0 + 0.0001537*T)*T M_rad = !dpi*(M/180.d0) e = 0.016708634d0 + (-0.000042037d0 - 0.0000001267d0*T)*T eqC = (1.914602d0 + (-0.004817d0 - 0.000014d0*T)*T)*sin(M_rad) + $ (0.019993d0 - 0.000101d0*T)*sin(2.d0*M_rad) + $ 0.000289d0*sin(3.d0*M_rad) nu = M + eqC R = 1.000001018d0*(1.d0-e^2)/(1.d0+e*cos(!dpi*(nu/180.d0))) Tau = R*AU2JC endfor return,R end