2 C------------------------------------------------------------------------------
4 double precision function alpha(i1,i2,i3)
6 c Calculates the planar angle between atoms (i1), (i2), and (i3).
10 include 'COMMON.CHAIN'
11 if (i1.lt.1 .or. i2.lt.1 .or. i3.lt.1 .or. i4.lt.1) then
21 vnorm=dsqrt(x12*x12+y12*y12+z12*z12)
22 wnorm=dsqrt(x23*x23+y23*y23+z23*z23)
23 scalar=(x12*x23+y12*y23+z12*z23)/(vnorm*wnorm)
28 C------------------------------------------------------------------------------
30 double precision function beta(i1,i2,i3,i4)
32 c Calculates the dihedral angle between atoms (i1), (i2), (i3) and (i4)
36 include 'COMMON.CHAIN'
37 if (i1.lt.1 .or. i2.lt.1 .or. i3.lt.1 .or. i4.lt.1) then
50 cd print '(2i3,3f10.5)',i1,i2,x12,y12,z12
51 cd print '(2i3,3f10.5)',i2,i3,x23,y23,z23
52 cd print '(2i3,3f10.5)',i3,i4,x34,y34,z34
56 wnorm=dsqrt(wx*wx+wy*wy+wz*wz)
60 vnorm=dsqrt(vx*vx+vy*vy+vz*vz)
61 if (vnorm.gt.1.0D-13 .and. wnorm.gt.1.0D-13) then
62 scalar=(vx*wx+vy*wy+vz*wz)/(vnorm*wnorm)
63 if (dabs(scalar).gt.1.0D0)
64 &scalar=0.99999999999999D0*scalar/dabs(scalar)
66 cd print '(2i4,10f7.3)',i2,i3,vx,vy,vz,wx,wy,wz,vnorm,wnorm,
71 c if (angle.le.0.0D0) angle=pi+angle
75 scalar=tx*x23+ty*y23+tz*z23
76 if (scalar.lt.0.0D0) angle=-angle
81 C------------------------------------------------------------------------------
85 c Calculates the distance between atoms (i1) and (i2).
89 include 'COMMON.CHAIN'
90 if (i1.lt.1 .or. i2.lt.1) then
97 dist=dsqrt(x12*x12+y12*y12+z12*z12)