201 void palPv2el (
const double pv[6],
double date,
double pmass,
int jformr,
202 int *jform,
double *epoch,
double *orbinc,
203 double *anode,
double *perih,
double *aorq,
double *e,
204 double *aorl,
double *dm,
int *jstat ) {
207 const double SE = 0.3977771559319137;
208 const double CE = 0.9174820620691818;
211 const double RMIN = 1e-3;
212 const double VMIN = 1e-8;
215 const double PARAB = 1.0e-8;
217 double X,Y,Z,XD,YD,ZD,R,V2,V,RDV,GMU,HX,HY,HZ,
218 HX2PY2,H2,H,OI,BIGOM,AR,ECC,S,
C,AT,U,OM,
219 GAR3,EM1,EP1,HAT,SHAT,CHAT,AE,AM,DN,PL,
229 if (jformr < 1 || jformr > 3) {
239 Y = pv[1]*CE+pv[2]*SE;
240 Z = -pv[1]*SE+pv[2]*CE;
248 R = sqrt(X*X+Y*Y+Z*Z);
249 V2 = XD*XD+YD*YD+ZD*ZD;
253 if (R < RMIN || V < VMIN) {
259 RDV = X*XD+Y*YD+Z*ZD;
270 HX2PY2 = HX*HX+HY*HY;
275 OI = atan2(sqrt(HX2PY2),HZ);
278 if (HX != 0.0 || HY != 0.0) {
279 BIGOM = atan2(HX,-HY);
288 ECC = sqrt(
DMAX(1.0-AR*H2/GMU,0.0));
293 if (S != 0.0 || C != 0.0) {
302 U = atan2((-X*S+Y*C)*cos(OI)+Z*sin(OI),X*C+Y*S);
308 if (fabs(ECC-1.0) < PARAB) ECC=1.0;
333 AE = 2.0*atan2(sqrt(-EM1)*SHAT,sqrt(EP1)*CHAT);
371 TP = date-THAT*(1.0+THAT*THAT/3.0)*H*H2/(2.0*GMU*GMU);
376 THHF = sqrt(EM1/EP1)*THAT;
377 F = log(1.0+THHF)-log(1.0-THHF);
378 TP = date-(ECC*sinh(F)-F)/sqrt(-GAR3);
394 if (JF == 2) *aorl =
eraAnp(AM);
static const double PAL__GCON
void palPv2el(const double pv[6], double date, double pmass, int jformr, int *jform, double *epoch, double *orbinc, double *anode, double *perih, double *aorq, double *e, double *aorl, double *dm, int *jstat)
static const double PAL__SPD