import math class Point(): def __init__(this, x, y): if (x != 0): this.theta = math.atan(y/x) elif (y > 0): this.theta = math.pi/2 else: this.theta = -math.pi/2 this.radius = math.sqrt(x*x + y*y) def getx(this): return this.radius * math.cos(this.theta) def gety(this): return this.radius * math.sin(this.theta)