SUBROUTINE FPDCA
*-- Author :    R. Henderson   24/10/94
      SUBROUTINE FPDCA(TODIG,VDIG,TOCLS,VCLS,DIST)
C----                                                                                                         
C------------------------------------------------------------                                                 
C-----  FIND dca for the vectors a = todig + x*vdig                                                           
C-----           and the vectors b = tocls + x*vcls                                                           
C------------------------------------------------------------                                                 
C----                                                                                                         
      DIMENSION UVWSOL(3)                                               
      DOUBLE PRECISION ATRIX(3,3),BTRIX(3),WORK(100)                    
      DIMENSION TODIG(3),VDIG(3),TOCLS(3),VCLS(3),TCP(3)                
C----                                                                                                         
          CALL VUNIT(VCLS,VCLS,3)                                                                      
C----                                                                                                         
          TCP(1) = VCLS(2)*VDIG(3)                                      
     1               - VCLS(3)*VDIG(2)                                  
          TCP(2) = VCLS(3)*VDIG(1)                                      
     1               - VCLS(1)*VDIG(3)                                  
          TCP(3) = VCLS(1)*VDIG(2)                                      
     1               - VCLS(2)*VDIG(1)                                  
C---                                                                                                          
          CALL VUNIT(TCP,TCP,3)                                                                        
C---                                                                                                          
          ATRIX(1,1) = VCLS(1)                                          
          ATRIX(1,2) = VCLS(2)                                          
          ATRIX(1,3) = VCLS(3)                                          
          ATRIX(2,1) = -VDIG(1)                                         
          ATRIX(2,2) = -VDIG(2)                                         
          ATRIX(2,3) = -VDIG(3)                                         
          ATRIX(3,1) = TCP(1)                                           
          ATRIX(3,2) = TCP(2)                                           
          ATRIX(3,3) = TCP(3)                                           
C---                                                                                                          
          CALL DINV(3,ATRIX,3,WORK,IFAIL)                                                              
C---                                                                                                          
          BTRIX(1) = TOCLS(1)-TODIG(1)                                  
          BTRIX(2) = TOCLS(2)-TODIG(2)                                  
          BTRIX(3) = TOCLS(3)-TODIG(3)                                  
C---                                                                                                          
           CALL VZERO(UVWSOL,3)                                                                        
           DO 995 IC = 3,3                                              
           DO 996 IR = 1,3                                              
           UVWSOL(IC) = UVWSOL(IC) + ATRIX(IR,IC)*BTRIX(IR)             
  996      CONTINUE                                                     
  995      CONTINUE                                                     
C                                                                                                             
C---       Assign DIST to UVWSOL(3)                                                                           
C                                                                                                             
           DIST = UVWSOL(3)                                             
C                                                                                                             
           END                                                          
*