pub fn dscom(
epoch: f64,
ep: f64,
argpp: f64,
tc: f64,
inclp: f64,
nodep: f64,
np: f64,
snodm: &mut f64,
cnodm: &mut f64,
sinim: &mut f64,
cosim: &mut f64,
sinomm: &mut f64,
cosomm: &mut f64,
day: &mut f64,
e3: &mut f64,
ee2: &mut f64,
em: &mut f64,
emsq: &mut f64,
gam: &mut f64,
peo: &mut f64,
pgho: &mut f64,
pho: &mut f64,
pinco: &mut f64,
plo: &mut f64,
rtemsq: &mut f64,
se2: &mut f64,
se3: &mut f64,
sgh2: &mut f64,
sgh3: &mut f64,
sgh4: &mut f64,
sh2: &mut f64,
sh3: &mut f64,
si2: &mut f64,
si3: &mut f64,
sl2: &mut f64,
sl3: &mut f64,
sl4: &mut f64,
s1: &mut f64,
s2: &mut f64,
s3: &mut f64,
s4: &mut f64,
s5: &mut f64,
s6: &mut f64,
s7: &mut f64,
ss1: &mut f64,
ss2: &mut f64,
ss3: &mut f64,
ss4: &mut f64,
ss5: &mut f64,
ss6: &mut f64,
ss7: &mut f64,
sz1: &mut f64,
sz2: &mut f64,
sz3: &mut f64,
sz11: &mut f64,
sz12: &mut f64,
sz13: &mut f64,
sz21: &mut f64,
sz22: &mut f64,
sz23: &mut f64,
sz31: &mut f64,
sz32: &mut f64,
sz33: &mut f64,
xgh2: &mut f64,
xgh3: &mut f64,
xgh4: &mut f64,
xh2: &mut f64,
xh3: &mut f64,
xi2: &mut f64,
xi3: &mut f64,
xl2: &mut f64,
xl3: &mut f64,
xl4: &mut f64,
nm: &mut f64,
z1: &mut f64,
z2: &mut f64,
z3: &mut f64,
z11: &mut f64,
z12: &mut f64,
z13: &mut f64,
z21: &mut f64,
z22: &mut f64,
z23: &mut f64,
z31: &mut f64,
z32: &mut f64,
z33: &mut f64,
zmol: &mut f64,
zmos: &mut f64,
) {
const ZES: f64 = 0.01675;
const ZEL: f64 = 0.05490;
const C1SS: f64 = 2.9864797e-6;
const C1L: f64 = 4.7968065e-7;
const ZSINIS: f64 = 0.39785416;
const ZCOSIS: f64 = 0.91744867;
const ZCOSGS: f64 = 0.1945905;
const ZSINGS: f64 = -0.98088458;
const TWOPI: f64 = 2.0 * std::f64::consts::PI;
let mut a1: f64;
let mut a2: f64;
let mut a3: f64;
let mut a4: f64;
let mut a5: f64;
let mut a6: f64;
let mut a7: f64;
let mut a8: f64;
let mut a9: f64;
let mut a10: f64;
let betasq: f64;
let mut cc: f64;
let ctem: f64;
let stem: f64;
let mut x1: f64;
let mut x2: f64;
let mut x3: f64;
let mut x4: f64;
let mut x5: f64;
let mut x6: f64;
let mut x7: f64;
let mut x8: f64;
let xnodce: f64;
let xnoi: f64;
let mut zcosg: f64;
let zcosgl: f64;
let mut zcosh: f64;
let zcoshl: f64;
let mut zcosi: f64;
let zcosil: f64;
let mut zsing: f64;
let zsingl: f64;
let mut zsinh: f64;
let zsinhl: f64;
let mut zsini: f64;
let zsinil: f64;
let mut zx: f64;
let zy: f64;
*nm = np;
*em = ep;
*snodm = f64::sin(nodep);
*cnodm = f64::cos(nodep);
*sinomm = f64::sin(argpp);
*cosomm = f64::cos(argpp);
*sinim = f64::sin(inclp);
*cosim = f64::cos(inclp);
*emsq = *em * *em;
betasq = 1.0 - *emsq;
*rtemsq = f64::sqrt(betasq);
*peo = 0.0;
*pinco = 0.0;
*plo = 0.0;
*pgho = 0.0;
*pho = 0.0;
*day = epoch + 18261.5 + tc / 1440.0;
xnodce = (4.5236020 - 9.2422029e-4 * *day) % TWOPI;
stem = f64::sin(xnodce);
ctem = f64::cos(xnodce);
zcosil = 0.91375164 - 0.03568096 * ctem;
zsinil = f64::sqrt(1.0 - zcosil * zcosil);
zsinhl = 0.089683511 * stem / zsinil;
zcoshl = f64::sqrt(1.0 - zsinhl * zsinhl);
*gam = 5.8351514 + 0.0019443680 * *day;
zx = 0.39785416 * stem / zsinil;
zy = zcoshl * ctem + 0.91744867 * zsinhl * stem;
zx = f64::atan2(zx, zy);
zx = *gam + zx - xnodce;
zcosgl = f64::cos(zx);
zsingl = f64::sin(zx);
zcosg = ZCOSGS;
zsing = ZSINGS;
zcosi = ZCOSIS;
zsini = ZSINIS;
zcosh = *cnodm;
zsinh = *snodm;
cc = C1SS;
xnoi = 1.0 / *nm;
for lsflg in 1..3 {
a1 = zcosg * zcosh + zsing * zcosi * zsinh;
a3 = -zsing * zcosh + zcosg * zcosi * zsinh;
a7 = -zcosg * zsinh + zsing * zcosi * zcosh;
a8 = zsing * zsini;
a9 = zsing * zsinh + zcosg * zcosi * zcosh;
a10 = zcosg * zsini;
a2 = *cosim * a7 + *sinim * a8;
a4 = *cosim * a9 + *sinim * a10;
a5 = -*sinim * a7 + *cosim * a8;
a6 = -*sinim * a9 + *cosim * a10;
x1 = a1 * *cosomm + a2 * *sinomm;
x2 = a3 * *cosomm + a4 * *sinomm;
x3 = -a1 * *sinomm + a2 * *cosomm;
x4 = -a3 * *sinomm + a4 * *cosomm;
x5 = a5 * *sinomm;
x6 = a6 * *sinomm;
x7 = a5 * *cosomm;
x8 = a6 * *cosomm;
*z31 = 12.0 * x1 * x1 - 3.0 * x3 * x3;
*z32 = 24.0 * x1 * x2 - 6.0 * x3 * x4;
*z33 = 12.0 * x2 * x2 - 3.0 * x4 * x4;
*z1 = 3.0 * (a1 * a1 + a2 * a2) + *z31 * *emsq;
*z2 = 6.0 * (a1 * a3 + a2 * a4) + *z32 * *emsq;
*z3 = 3.0 * (a3 * a3 + a4 * a4) + *z33 * *emsq;
*z11 = -6.0 * a1 * a5 + *emsq * (-24.0 * x1 * x7 - 6.0 * x3 * x5);
*z12 = -6.0 * (a1 * a6 + a3 * a5)
+ *emsq * (-24.0 * (x2 * x7 + x1 * x8) - 6.0 * (x3 * x6 + x4 * x5));
*z13 = -6.0 * a3 * a6 + *emsq * (-24.0 * x2 * x8 - 6.0 * x4 * x6);
*z21 = 6.0 * a2 * a5 + *emsq * (24.0 * x1 * x5 - 6.0 * x3 * x7);
*z22 = 6.0 * (a4 * a5 + a2 * a6)
+ *emsq * (24.0 * (x2 * x5 + x1 * x6) - 6.0 * (x4 * x7 + x3 * x8));
*z23 = 6.0 * a4 * a6 + *emsq * (24.0 * x2 * x6 - 6.0 * x4 * x8);
*z1 = *z1 + *z1 + betasq * *z31;
*z2 = *z2 + *z2 + betasq * *z32;
*z3 = *z3 + *z3 + betasq * *z33;
*s3 = cc * xnoi;
*s2 = -0.5 * *s3 / *rtemsq;
*s4 = *s3 * *rtemsq;
*s1 = -15.0 * *em * *s4;
*s5 = x1 * x3 + x2 * x4;
*s6 = x2 * x3 + x1 * x4;
*s7 = x2 * x4 - x1 * x3;
if lsflg == 1 {
*ss1 = *s1;
*ss2 = *s2;
*ss3 = *s3;
*ss4 = *s4;
*ss5 = *s5;
*ss6 = *s6;
*ss7 = *s7;
*sz1 = *z1;
*sz2 = *z2;
*sz3 = *z3;
*sz11 = *z11;
*sz12 = *z12;
*sz13 = *z13;
*sz21 = *z21;
*sz22 = *z22;
*sz23 = *z23;
*sz31 = *z31;
*sz32 = *z32;
*sz33 = *z33;
zcosg = zcosgl;
zsing = zsingl;
zcosi = zcosil;
zsini = zsinil;
zcosh = zcoshl * *cnodm + zsinhl * *snodm;
zsinh = *snodm * zcoshl - *cnodm * zsinhl;
cc = C1L;
}
}
*zmol = (4.7199672 + 0.22997150 * *day - *gam) % TWOPI;
*zmos = (6.2565837 + 0.017201977 * *day) % TWOPI;
*se2 = 2.0 * *ss1 * *ss6;
*se3 = 2.0 * *ss1 * *ss7;
*si2 = 2.0 * *ss2 * *sz12;
*si3 = 2.0 * *ss2 * (*sz13 - *sz11);
*sl2 = -2.0 * *ss3 * *sz2;
*sl3 = -2.0 * *ss3 * (*sz3 - *sz1);
*sl4 = -2.0 * *ss3 * (-21.0 - 9.0 * *emsq) * ZES;
*sgh2 = 2.0 * *ss4 * *sz32;
*sgh3 = 2.0 * *ss4 * (*sz33 - *sz31);
*sgh4 = -18.0 * *ss4 * ZES;
*sh2 = -2.0 * *ss2 * *sz22;
*sh3 = -2.0 * *ss2 * (*sz23 - *sz21);
*ee2 = 2.0 * *s1 * *s6;
*e3 = 2.0 * *s1 * *s7;
*xi2 = 2.0 * *s2 * *z12;
*xi3 = 2.0 * *s2 * (*z13 - *z11);
*xl2 = -2.0 * *s3 * *z2;
*xl3 = -2.0 * *s3 * (*z3 - *z1);
*xl4 = -2.0 * *s3 * (-21.0 - 9.0 * *emsq) * ZEL;
*xgh2 = 2.0 * *s4 * *z32;
*xgh3 = 2.0 * *s4 * (*z33 - *z31);
*xgh4 = -18.0 * *s4 * ZEL;
*xh2 = -2.0 * *s2 * *z22;
*xh3 = -2.0 * *s2 * (*z23 - *z21);
}