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