/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:32: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 "selpii.h" #include /* PARAMETER translations */ #define PIHALF 1.570796326794896619231322e0 /* end of PARAMETER translations */ void /*FUNCTION*/ selpii( float phi, float k2, float alpha2, float *p, long *ierr) { float a, b, c, r, rf, s, s2; /* Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>>1996-05-02 SELPII Krogh Fixed "max" for C conversion. *>>1994-10-20 SELPII Krogh Changes to use M77CON *>>1991-10-10 SELPII WV Snyder JPL Original code. * ---------------------------------------------------------------------- * COMPUTES REAL ELLIPTIC INTEGRAL OF THE THIRD KIND * ---------------------------------------------------------------------- */ /* IERR = 0..3, AS FOR SRJVAL AND SRFVAL * IERR = 4 IF ABS(PHI) > PI/2. * *--S replaces "?": ?ELPII, ?ERM1, ?RFVAL, ?RJVAL * -------------------- */ /* ---------------------------------------------------------------------- */ if (fabsf( phi ) > PIHALF) { *ierr = 4; serm1( "SELPII", 4, 0, "ABS(PHI) > PI/2", "PHI", phi, '.' ); return; } s = sinf( phi ); c = cosf( phi ); a = c*c; s2 = s*s; b = 1.0 - k2*s2; s2 *= alpha2; r = 1.0 - s2; c = fmaxf( a, fmaxf( b, r ) ); a *= c; b *= c; r *= c; srjval( a, b, c, r, p, ierr ); if (*ierr == 0) { srfval( a, b, c, &rf, ierr ); *p = sqrtf( c )*s*((s2*c**p)/3.0 + rf); } return; } /* end of function */