Question: Slide Type Slide V Excercise #2 Write a python code that solve a function called distwithRef() that receives the x and y coordinates of two

Slide Type Slide V Excercise #2 Write a python code that solve a function called distwithRef() that receives the x and y coordinates of two points: (x1, y1) and (x2, y2) and a reference distance d. The function returns the Euclidian distance between the two points (if the distance 2 d) or -1 otherwise . In the main you should check if - 1 is returned. you print: The distance is less than required, otherwise the returned distance is printed. The following are sample runs of the program Slide Type Slide Type Sample run 1: Enter the coordinates of first point: 1 Enter the coordinates of second point: -1 5 What is your reference distance 2 The distance between you two points is 2.24 Sample run 2: Enter the coordinates of first point: 1.5 -2 Enter the coordinates of second point 3 0 What is your reference distance 5 The distance is less than required
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
