/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:04 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "dcos1.h" #include double /*FUNCTION*/ dcos1( double x) { double c, dcos1_v, sinc; /* Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>> 1994-10-20 DCOS1 Krogh Changes to use M77CON *>> 1993-07-21 DCOS1 WV Snyder JPL Original code * * compute (1 - cos(x)) / x**2. * *--D replaces "?": ?COS1 * */ if (x == 0.0e0) { dcos1_v = 0.5e0; } else { c = cos( x ); if (c <= 0.0) { dcos1_v = (1.0e0 - c)/x*x; } else { sinc = sin( x )/x; dcos1_v = SQ(sinc)/(1.0e0 + c); } } return( dcos1_v ); } /* end of function */