Programming Assignment: Extending the Point class and implementing a Comparator class for sorting points. Due: Monday, June 18 @11:30am ------------------------------------------------------------------- Part I: Complete and document the unimplemented methods after the TODO comment: radius() // distance to origin angle() // Theta according to Polar coordinates distanceTo(Point) // Euclidean distance rotate(double) // rotate counter-clockwise // amount given in degrees readPoints(Scanner) Format assumed by readPoints: just a sequence of double values where the first and second values are x1 and y1 and so on. Example: 2 7 3 9 2 -9 represents points (2,7), (3.9), (2,-9) Error checking: if you reach an input token that cannot be read as a Double, stop and return the collection of points you've read so far. If the input doesn't specify the y-coord of the last point (i.e., the number of values is odd), simply ignore the last x-coordinate. Note: Collection is an interface. Many classes implement it including ArrayList. Part II: Complete and document the PointCmp class which implements the Comparator interface. It should behave as described in the comments (allowing ordering by either x or y). Recall that the compare(a, b) method is suppose to return: a negative number if "p1 < p2" zero if p1 and p2 are equal a positive number if "p1 > p2" References: Comparator interface: http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html Scanner class: http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html Collection interface: http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html Math class: http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html Polar coordinates: http://en.wikipedia.org/wiki/Polar_coordinate_system