C234567
      PROGRAM POLCAR
C
C.....Converts polar to cartesian coordinates.
C
      REAL RCOORD, TCOORD_D, TCOORD_R,  XCOORD, YCOORD, PI
      PARAMETER (PI = 3.141592654)
      COMMON /COORDS/ RCOORD, TCOORD_R, XCOORD, YCOORD
      INTEGER RESPON
      RESPON = 1
  10  IF (RESPON .EQ. 1) THEN
        WRITE(*,*) 'Dwse tis polikes suvt/nes r & theta',
     &             ' (theta se moires)'
        READ(*,*) RCOORD,TCOORD_D
        WRITE(*,*)'Polar coordinates:'
        WRITE(*,100) RCOORD,TCOORD_D
C.....Metatropn tns gwvias apo moires se aktivia (rad)
        TCOORD_R = (TCOORD_D * PI)/180.
        CALL CONVER
        WRITE(*,*)'Cartesian coordinates:'
        WRITE(*,100) XCOORD,YCOORD
        WRITE(*,*)
        WRITE(*,*)'More points to convert?'
        WRITE(*,*)'1 for yes, 0 for no'
        READ(*,*) RESPON
        GOTO 10
      ENDIF
 100  FORMAT(2F12.6)
      STOP
      END


      SUBROUTINE CONVER
      REAL R,THETA,X,Y
      COMMON /COORDS/ R,THETA,X,Y
      X = R*COS(THETA)
      Y = R*SIN(THETA)
      RETURN
      END
