c234567
      program kin
      implicit real*8 (a-h,o-z)
      hc=197.3d0
      ei=200.d0
      am=938.d0
      it=12
      ir=11
      tdef=0.d0
      rdef=0.d0
      ealp=0.d0
      amt=it*am-tdef
      amr=ir*am-rdef+ealp
      tpf=0.d0      
      do 200 itpf=1,20

      tpf=tpf+10.d0
      print*,itpf,tpf
      epf=am+tpf
      akpf=dsqrt(epf*epf-am*am)

      do 100 ef=0.d0,ei+amt-amr-epf,10.d0

      w=ei-ef

      er=w-epf+amt

      akr=dsqrt(er*er-amr*amr)


      minfq=abs(akr-akpf)
      maxfq=akr+akpf


      miniq=w
      maxiq=ei+ef
      qmin=max(miniq,minfq)
      qmax=min(maxfq,maxiq)

      write(10,*)qmin,qmax,tpf
c      if(qmax.ge.qmin)then
      if(qmax.ge.qmin)THEN 
      do 4100 iq=1,2
c      if(iq.eq.1)q=qmin
c      if(iq.eq.2)q=qmax
      print*
      do 1300 q=qmin,qmax,10.
      cosn=(q*q-ei*ei-ef*ef)/2.d0/ei/ef
      q2=q*q
      cosf=q2+akpf*akpf-akr*akr
      cosf=cosf/2.d0/q/akpf      
      cosm=akpf/akr*cosf-q/akr
      print*,q,cosf,cosm
1300  continue
      write(10,'(6e13.5)')tpf,cosn,cosf,akpf,q,akr
      print300,tpf,cosn,cosf,akpf,q,akr
4100  continue
      endif

100   continue
200   continue
300   format(6e13.5)
      end    
      


      
