Nbody6
inclin.f
Go to the documentation of this file.
1  SUBROUTINE inclin(X,V,XCM,VCM,ALPHA)
2 *
3 *
4 * Inclination of hierarchical system.
5 * -----------------------------------
6 *
7  REAL*8 a12,a22,a1a2,fac,alpha
8  REAL*8 xcm(3),vcm(3),x(3,3),v(3,3),a0(3),a2(3)
9 *
10 *
11 * Define inner binary I1 & I2 and outer component I3.
12  i1 = 1
13  i2 = 2
14  i3 = 3
15 *
16 * Evaluate scalar products of angular momenta.
17  a12 = 0.0
18  a22 = 0.0
19  a1a2 = 0.0
20  DO 20 k = 1,3
21  k1 = k + 1
22  IF (k1.GT.3) k1 = 1
23  k2 = k1 + 1
24  IF (k2.GT.3) k2 = 1
25  a0(k) = (x(k1,i1) - x(k1,i2))*(v(k2,i1) - v(k2,i2))
26  & - (x(k2,i1) - x(k2,i2))*(v(k1,i1) - v(k1,i2))
27  a2(k) = (x(k1,i3) - xcm(k1))*(v(k2,i3) - vcm(k2))
28  & - (x(k2,i3) - xcm(k2))*(v(k1,i3) - vcm(k1))
29  a12 = a12 + a0(k)**2
30  a22 = a22 + a2(k)**2
31  a1a2 = a1a2 + a0(k)*a2(k)
32  20 CONTINUE
33 *
34 * Determine inclination in radians.
35  fac = a1a2/sqrt(a12*a22)
36  fac = min(fac,1.0d0)
37  alpha = acos(fac)
38 *
39  RETURN
40 *
41  END