      PROGRAM POLAR
************************************************************************
* This program accepts the polar coordinates of a point and displays   *
* the corresponding rectangular coordinates.  The subroutine CONVER is *
* used to effect the conversion; a COMMON statement is used to         *
* associate variables in the main program with variables in CONVER.    *
* 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:  RCCORD, TCOORD, and RESPON                                   *
* Output: XCOORD and YCOORD                                            *
************************************************************************

      INTEGER RESPON
      REAL RCOORD, TCOORD, XCOORD, YCOORD
      COMMON RCOORD, TCOORD, XCOORD, YCOORD

* Read and convert coordinates until user signals no more data

10    CONTINUE
          PRINT *, 'ENTER POLAR COORDINATES (IN RADIANS)'
          READ *, RCOORD, TCOORD
          CALL CONVER
          PRINT *, 'RECTANGULAR COORDINATES:'
          PRINT *, XCOORD, YCOORD
          PRINT *
          PRINT *, 'MORE POINTS TO CONVERT (0 = NO, 1 = YES)?'
          READ *, RESPON
      IF (RESPON .NE. 0) GO TO 10

      END


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

      SUBROUTINE CONVER

      REAL R, THETA, X, Y
      COMMON R, THETA, X, Y

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

