      logical*4 function ca_coupe_clip(x,y,xc,yc)
      INCLUDE 'Parametres.f'
      REAL*4 X,Y,XC,YC
      logical*4 toto
c
      if (  (x.ge.x0_clip2.and.x.le.x1_clip2.and.
     &       y.ge.y0_clip2.and.y.le.y1_clip2)  .or.
     &      (xc.ge.x0_clip2.and.xc.le.x1_clip2.and.
     &       yc.ge.y0_clip2.and.yc.le.y1_clip2) ) then
        toto = .true.
      else
        toto = .false.
        if (x.eq.xc) then
          if (x.lt.x0_clip2.or.x.gt.x1_clip2) goto 10
          if (y.le.y0_clip2.and.yc.ge.y0_clip2) then
            toto=.true.
            goto 10
          endif
          if (yc.le.y0_clip2.and.y.ge.y0_clip2) then
            toto=.true.
            goto 10
          endif
          if (y.le.y1_clip2.and.yc.ge.y1_clip2) then
            toto=.true.
            goto 10
          endif
          if (yc.le.y1_clip2.and.y.ge.y1_clip2) then
            toto=.true.
            goto 10
          endif
        else
          a = (y-yc)/(x-xc)
          b = y-a*x
          yy = a*x0_clip2 + b
          if (yy.ge.y0_clip2.and.yy.le.y1_clip2.and.
     &       ((x-x0_clip2)*(xc-x0_clip2)).le.0.) then
            toto = .true.
            goto 10
          endif
          yy = a*x1_clip2 + b
          if (yy.ge.y0_clip2.and.yy.le.y1_clip2.and.
     &       ((x-x1_clip2)*(xc-x1_clip2)).le.0.) then
            toto = .true.
            goto 10
          endif
          if (a.eq.0.) goto 10
          xx = (y0_clip2-b)/a
          if (xx.ge.x0_clip2.and.xx.le.x1_clip2.and.
     &       ((y-y0_clip2)*(yc-y0_clip2)).le.0.) then
            toto = .true.
            goto 10
          endif
          xx = (y1_clip2-b)/a
          if (xx.ge.x0_clip2.and.xx.le.x1_clip2.and.
     &       ((y-y1_clip2)*(yc-y1_clip2)).le.0.) then
            toto = .true.
            goto 10
          endif
        endif
      endif
c
  10  ca_coupe_clip = toto
      end
