Question: using python 3 :# your new code goes here, instantiate twoPoint objects. Given that two points fall on the circumference of a circle, find and

using python 3:# your new code goes here, instantiate twoPoint objects. Given that two points fall on the circumference of a circle, find and display the center and radius of that circle.

class Point:

def __init__(self, initX, initY): """ Create a new point at the given coordinates """ self.__x = initX self.__y = initY

def getX(self): """ Get its x coordinate """ return self.__x

def getY(self): """ Get its y coordinate """ return self.__y

def __str__(self): """ Return a string representation of the point """ return "({}, {})".format(self.__x, self.__y)

def halfway(self, other): """ Create a point halfway between self and other """ mx = (self.__x + other.__x) / 2 my = (self.__y + other.__y) / 2 return Point(mx, my)

def distFromOrigin(self): """ Return the distance from self to (0,0) """ return (self.__x**2 + self.__y**2)**0.5

def distFrom(self, other): """ Return the distance from self to other """ return ((self.__x - other.__x)**2 + (self.__y - other.__y)**2)**0.

# your new code goes here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!