function cos_f, mean_anom, ecc ;+ ; NAME: ; cos_f ; ; PURPOSE: ; This function returns the cosine of the true anomaly, using relations given in ; Murray & Dermott (1999), ch. 2.4. This routine uses keplereq.pro. ; ; CATEGORY: ; Celestial Mechanics. ; ; CALLING SEQUENCE: ; Result = cos_f(mean_anom, ecc) ; ; INPUTS: ; mean_anom: orbital mean anomaly ; ecc: orbital eccentricity ; ; OUTPUTS: ; Cosine of the orbital true anomaly ; ; EXAMPLE: ; ;make mean anomaly array ; num = 101 ; mean_anom = 2.*!pi*dindgen(num) ; ;orbital eccentricity of 0.1 ; ecc = 0.1 ; cos_f = cos_f(mean_anom, ecc) ; ; MODIFICATION HISTORY: ; Written by: Brian Jackson (decaelus@gmail.com), 2011 Jul 25. ;- ;Call keplereq to calculate eccentric anomaly from mean anomaly ecc_anom = keplereq(mean_anom, ecc) return, (cos(ecc_anom)-ecc)/(1.-ecc*cos(ecc_anom)) end;function