      subroutine plate_position(a,alpha,d,delta,x,y,
     $     pix_width,focal_length)
C     
C This routine returns the photographic plate position of an object (x,y)
C with the telescope axis directed at another object with right ascension 
C (a) and declination (d) (in radians). The object's position is given by
C right ascension (alpha) and declination (delta), again in radians. The 
C pixel width and focal length of the telescope are also required for 
C proper scaling. These two quantities should be in the same units.
C     
C Name          Type    In/out  Purpose
C
C a             real*8  in      Right ascension of telescope axis (radians)
C alpha         real*8  in      Right ascension of object (radians)
C d             real*8  in      Declination of telescope axis (radians)
C delta         real*8  in      Declination of object (radians)
C x             real*8  out     Plate position (x-axis) of object (in pixels)
C y             real*8  out     Plate position (y-axis) of object (in pixels)
C pix_width     real*8  in      Width of a pixel (assumed square)
C focal_length  real*8  in      Focal length of telescope
C
C  Note that pix_width and focal_length must be expressed in the same units.
C
      implicit none
      real*8 a,alpha,d,delta,x,y,pix_width,focal_length,
     $     factor,tandelta,tand,cosbeta,s,beta
      factor=pix_width/focal_length
      beta=alpha-a
      tandelta=dtan(delta)
      tand=dtan(d)
      cosbeta=dcos(beta)
      s=(cosbeta+tandelta*tand)*factor
      x=dsin(beta)/dcos(d)/s
      y=(tandelta-tand*cosbeta)/s
      return
      end
