1 SUBROUTINE himax2(I1,ECC,SEMI,ECC1,SEMI1,EMAX,EMIN,ZI,TG,EDAV)
8 REAL*8 a1(3),a2(3),xrel(3),vrel(3),ei(3),hi(3),ho(3),bhat(3)
21 xrel(k) = x(k,i1) - x(k,i2)
22 vrel(k) = xdot(k,i1) - xdot(k,i2)
37 a1(k) = xrel(k1)*vrel(k2) - xrel(k2)*vrel(k1)
38 a2(k) = (x(k1,jcomp)-x(k1,icm))*(xdot(k2,jcomp)-xdot(k2,icm))
39 & - (x(k2,jcomp)-x(k2,icm))*(xdot(k1,jcomp)-xdot(k1,icm))
42 a1a2 = a1a2 + a1(k)*a2(k)
43 ri2 = ri2 + xrel(k)**2
44 vi2 = vi2 + vrel(k)**2
45 rvi = rvi + xrel(k)*vrel(k)
49 zmb = body(i1) + body(i2)
51 fac = a1a2/sqrt(a12*a22)
57 ei(k) = (vi2*xrel(k) - rvi*vrel(k))/body(icm) -
66 ei(k) = ei(k)/sqrt(ei2)
67 hi(k) = a1(k)/sqrt(a12)
68 ho(k) = a2(k)/sqrt(a22)
69 cosj = cosj + hi(k)*ho(k)
70 sjsg = sjsg + ei(k)*ho(k)
81 bhat(k) = hi(k1)*ei(k2) - hi(k2)*ei(k1)
83 bh = bh + bhat(k)*ho(k)
87 a = cosj*sqrt(1.0 - ei2)
88 z = (1.0 - ei2)*(2.0 - cosj**2) + 5.0*ei2*sjsg**2
91 z2 = z**2 + 25.0 + 16.0*a**4 - 10.0*z - 20.0*a**2 - 8.0*a**2*z
92 emax = one6*(z + 1.0 - 4.0*a**2 + sqrt(z2))
98 az1 = 1.0 + z - 4.0*a**2
99 emin2 = one6*(az1 - sqrt(az1**2 - 12.0*az))
101 emin2 = 1.0 - 0.5*(a**2 + z)
103 emin2 = max(emin2,0.0d0)
107 zmb2 = zmb + body(jcomp)
108 tk = twopi*semi*sqrt(semi/zmb)
109 tk1 = twopi*abs(semi1)*sqrt(abs(semi1)/zmb2)
110 tg = tk1**2*zmb2*(1.0 - ecc1**2)**1.5/(body(jcomp)*tk)
120 yfac = 15.0*body(jcomp)/(4.0*zmb2)*twopi*tk/tk1**2
121 yfac = yfac*ecc*sqrt(1.0 - ecc**2)/(1.0 - ecc1**2)**(1.5)