Programming for Mathematics Assignment, 18 August 2014 1. Extend the definition of the class Point (see below) that uses an (r,theta) internal representation of a point to include the following functions. distance(p) Returns the Euclidean distance between the given point and another point p. translate(deltax,deltay) Shifts the given point from (x,y) to (x+deltax,y+deltay) 2. Should it be considered acceptable for these functions to directly access and make use of the internal state variables r and theta --- in particular, for distance(p), which needs to extract the coordinates of p? ====================================================================== from math import * class Point: def __init__(self,a,b): self.r = sqrt(a*a + b*b) self.theta = atan(float(b)/a) def setpoint(self,a,b): self.r = sqrt(a*a + b*b) self.theta = atan(float(b)/a) def getpoint(self): x = self.r*(cos(self.theta)) y = self.r*(sin(self.theta)) return(x,y) ======================================================================