Describes a dot in a two-dimensional space and a class


Question:

Help with a code file that contains a definition of a class point that describes a dot in a two-dimensional space, and a class Circle that describes a circle by the center of the circle, R, and its radius.

I have to use this function, def __lt__(self, other) : which compares two circles based on Comparison criterion: The maximum x coordinate of the points on the circle.

It also should Check that insertion_sort correctly sorts the list of circles created by the given function create_circles_list.

Here is a sample of a possible run:

>>> circles = create_circles_list(4)

>>> print circles

[c = (8,7) r = 13, c = (4,7) r = 12, c = (4,6) r = 0, c = (5,0) r = 3]

>>> insertion_sort(circles)

>>> print 'sorted:' circles

sorted : [c = (4,6) r = 0, c = (5,0) r = 3, c = (4,7) r = 12, c = (8,7) r = 13]

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Describes a dot in a two-dimensional space and a class
Reference No:- TGS02909429

Expected delivery within 24 Hours