      PROGRAM POLAR
************************************************************************
* This program accepts the polar coordinates of a point & displays     *
* the corresponding rectangular coordinates.  The subroutine CONVER is *
* used to effect the conversion.  Variables used are:                  *
*     RCOORD, TCOORD : polar coordinates of a point                    *
*     XCOORD, YCOORD : rectangular coordinates of a point              *
*     RESPON : user response to more-data question                     *
*                                                                      *
* Input:  RCOORD, TCOORD, and RESPON                                   *
* Output: XCOORD and YCOORD                                            *
************************************************************************

      REAL RCOORD, TCOORD, XCOORD, YCOORD
      CHARACTER *1 RESPON

* Read and convert coordinates until user signals no more data

 10       CONTINUE
         PRINT *, 'ENTER POLAR COORDINATES (IN RADIANS)'
         READ *, RCOORD, TCOORD
         CALL CONVER(RCOORD, TCOORD, XCOORD, YCOORD)
         PRINT *, 'RECTANGULAR COORDINATES:'
         PRINT *, XCOORD, YCOORD  
         PRINT *
         PRINT *, 'MORE POINTS TO CONVERT (Y OR N)?'
         READ '(A)', RESPON
      IF (RESPON .EQ. 'Y') GO TO 10
      END


**CONVER****************************************************************
* Subroutine to convert polar coordinates (R,THETA) to rectangular     *
* coordinates (X,Y).                                                   *
* Accepts:  Polar coordinates R and THETA                              *
* Returns:  Rectangular coordinates X and Y                            *
************************************************************************

      SUBROUTINE CONVER(R, THETA, X, Y)

      REAL R, THETA, X, Y

      X = R * COS(THETA)
      Y = R * SIN(THETA)

      END
