"""
A program that reads a Polar coordinate pair (r, theta) and converts it
into Cartesian coordinates (x, y).

Examples of conversions:
r = 1.0, theta = 0              | x = 1, y = 0
r = 2.0, theta = -1.57079632679 | x = 0, y = -2
r = 4.5, theta = 2.68           | x = -4.02904937628, y = 2.00418590044
r = 0, theta = 0                | x = 0, y = 0
r = 0, theta = 1                | x = 0, y = 0
"""

#Import some functions we need
from math import sin,cos

#Get the input from the user
r = float(input("Give r: "))
theta = float(input("Give theta: "))

#Calculate what we need
x = cos(theta)*r
y = sin(theta)*r

#Print it all
print "x:", x
print "y:", y
