Question: python 4. (3 points) write a function that takes four numbers that represent two points: (x1, yl) and (x2, y2), and return the distance between

python python 4. (3 points) write a function that takes four numbers that

4. (3 points) write a function that takes four numbers that represent two points: (x1, yl) and (x2, y2), and return the distance between them using the formula (x1 - x2)2 + (y1 - y2)2 5. (8 points) Using the distance function from question (4) above, write a function called max.distance that takes three arguments. The first argument is a list of tuples, where each tuple has two elments representing the coordinates of a point. The second and third arguments are the x and y coordinates of a point P. The function should find the point in the list that has the maximum distance from point P. Test your function with the following line of code. print (max_distance ([(12, 12), (2, 3), (5, 4), (12, -1)], 7, 7)) print(max_distance ([(, 0), (0, 1), (0.5, 1.5)], 1, 1)) You should get the following output (12, -1, 9.433981132056603) (0, 0, 1.4142135623730951) Process finished with exit code 0

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!