Question: In this problem, we consider a reference starting point O having the following coordinates O(1,1) in the xy-plane as shown in the figure below. The
In this problem, we consider a reference starting point O having the following coordinates O(1,1) in the xy-plane as shown in the figure below. The destination is located at a point A having (x,y) coordinates. The target is to walk a distance D. Create a function Check that checks whether the Manhattan distance between the starting point O and the destination point A is greater than the target distance D. Your function should then take as input the coordinates of the points O and A, as well as the target distance D. Your function should return true if the Manhattan distance between O and A is greater than D and false otherwise. The Manhattan distance can be computed as the sum of the absolute differences between the two points as follows: D=xAxB+yAyB Use your function to check for O(1,1),A(10,15) and D=10, and display the results as shown below. Note: In order to get the absolute value of a number, you may need to use the "math. h " library by including the following " sinclude " header and then call the function "fabs(a)" that returns the absolute value of a. You may need also to include \#include ." Sample input/output: Yes, the Manhattan distance between 0 and A is greater than D=10. - Submit your solution in a file called "Problem4. c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
