      subroutine rtshift(p,dp,a)
      real*8 pi
      parameter (pi=3.141592653589793D0)
c
      real*8 p(2),dp(2),a(2)
      real*8 ra,dec,dra,ddec
c
      ra=sin(p(2))*p(1)
      dec=cos(p(2))*p(1)
c
      dra=sin(dp(2))*dp(1)
      ddec=cos(dp(2))*dp(1)
c
      a(1)=sqrt((ra+dra)**2+(dec+ddec)**2)
      a(2)=atan2(ra+dra,dec+ddec)
      if(a(2).lt.0.D0)a(2)=a(2)+2.D0*pi
c
      return
      end
