      DOUBLE PRECISION FUNCTION INTX(X1,Y1,X2,Y2,X3,Y3,X4,Y4)
      DOUBLE PRECISION X1,Y1,X2,Y2,X3,Y3,X4,Y4
      DOUBLE PRECISION K1,K2

      K1=(Y2-Y1)/(X2-X1)
      K2=(Y4-Y3)/(X4-X3)
      INTX=(K1*X1-K2*X3+Y3-Y1)/(K1-K2)
      RETURN
      END
