C+ C NAME: C ElSunDistance C PURPOSE: C Calulates Electron-Sun distance and angle Sun-Electron-Observer C CALLING SEQUENCE: function ElSunDistance(ScSun,ScEl,Elo, SinChi) C INPUTS: C ScSun real Observer-Sun distance C ScEl real Observer-Electron distance C Elo real elongation of line of sight (deg), i.e. angle between C observer-Sun and observer-electron directions C (Elo = 0 is the direction observer-Sun) C OUTPUTS: C ElSunDistance C real Sun-Electron distance (same units as ScSun and ScEl) C SinChi real Sine of angle Sun-Electron-Observer C PROCEDURE: C Cosine and sine rule in triangle with Sun, Observer and Electron on C the corners. C MODIFICATION HISTORY: C SEP-1996, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- real ScSun real ScEl real Elo real SinChi ElSunDistance = max(0.,ScSun*ScSun+ScEl*ScEl-2.*ScSun*ScEl*cosd(Elo)) ElSunDistance = sqrt(ElSunDistance) SinChi = ScSun/ElSunDistance*sind(Elo) return end