      SUBROUTINE PERPEND(ARA,ADEC,BRA,BDEC,RAINT,DECINT,J)

      REAL*4    ARA(2), ADEC(2), BRA(2), BDEC(2)
      REAL*8    RAINT, DECINT
      INTEGER*4 J
C CALCULATE POINT ON MAJOR AXIS WHERE CURRENT MINOR 
C AXIS INTERSECTS:

D     WRITE(OUTC,*) ' Starting PERPEND'
D     WRITE(OUTC,'(A,F7.3,2X,F7.3)') 
D    1    ' PERPEND:  ARA, ADEC(1):  ',ARA(1),ADEC(1)
D     WRITE(OUTC,'(A,F7.3,2X,F7.3)') 
D    1    ' PERPEND:  ARA, ADEC(2):  ',ARA(2),ADEC(2)
D     WRITE(OUTC,'(A,I1,A,F7.3,2X,F7.3)') 
D    1    ' PERPEND:  BRA, BDEC(',J,'):  ',BRA(J),BDEC(J)
D     CALL PGASK(.TRUE.)
D     CALL PGADVANCE
D     CALL PGASK(.FALSE.)
      DECINT   = (ARA(1)-ARA(2))*(ADEC(1)-ADEC(2))*(BRA(J)-ARA(1))
      DECINT   = DECINT + BDEC(J) * (ADEC(1)-ADEC(2))**2
     1                  + ADEC(1) * (ARA(1) -ARA(2) )**2
      DECINT   = DECINT / ((ARA(1)-ARA(2))**2 + (ADEC(1)-ADEC(2))**2)

      RAINT    = ARA(1) 
     1             - (ADEC(1)-DECINT)*(ARA(1)-ARA(2))/(ADEC(1)-ADEC(2)) 
D     WRITE(OUTC,*) ' Finishing PERPEND'

      RETURN
      END

