So the question is:
The goal is to remove all points outside this rectangle from the Cloud much like you would crop an image. The crop method must deal with two input points on a horizontal or vertical line segment, in which case all points not on the line segment are removed, and it must deal with two equal Points p1 and p2, in which case all Points but p1 are removed from the Cloud.
So say for example I have a cloud of:
[(3.0,1.0), (2.0,2.0), (1.5,1.5), (3.0,0.0)]
and I call my crop method on p1,p4 I should come up with:
[(3.0,1.0), (3.0,0.0)]
I have a solution how would somoene else go about solving it(most efficent way possible)