      subroutine rot(ax,ay,az,bx,by,bz,nx,ny,nz,px,py,pz,s)
c
c  Subroutine ROT finds the sense of rotation of the vector 
c  from (ax,ay,az) to (bx,by,bz) with respect to a second 
c  vector through point (px,py,pz).  The second vector has 
c  components given by (nx,ny,nz).  Returned parameter s is 
c  1 if anticlockwise, -1 if clockwise, or 0 if colinear.
c
      real nx,ny,nz
      x=bx-ax
      y=by-ay
      z=bz-az
      call cross(nx,ny,nz,x,y,z,cx,cy,cz,c)
      u=px-ax
      v=py-ay
      w=pz-az
      d=u*cx+v*cy+w*cz
      if(d)2,3,4
    2 s=1.
      go to 1
    3 s=0.
      go to 1
    4 s=-1.
    1 continue
      return
      end
