Question: Write a program that will find the distance and angle between 2 points where each point is represented as a pair of x-y coordinates. You

Write a program that will find the distance and angle between 2 points where each point is represented as a pair of x-y coordinates. You will need to use the Pythagorean theorem to find the distance You will need to use a trig function to find the angle in degrees. Hint: use the atan2() function. Use the following: const double PI = 3.14159265358979323846; you need to write a single function getValues() that gives both the distance and angle (in degrees) 2) Request the values of x and y for point 2 3) Call you function and print the results All input and output must be from main. Sample output: Enter x and y value for the first point (seperated by a space): 0 0 Enter x and y value for the second point (seperated by a space): 1 1 The distance is: 1.41421 The angle is: 45 Enter x and y value for the first point (seperated by a space): 1 1 Enter x and y value for the second point (seperated by a space): 0 0 The distance is: 1.41421 The angle is: -135 Enter x and y value for the first point (seperated by a space): 0 0 Enter x and y value for the second point (seperated by a space): -1.5 1.5 The distance is: 2.12132 The angle is: 135 Enter x and y value for the first point (seperated by a space): 1 1 Enter x and y value for the second point (seperated by a space): -1 -1 The distance is: 2.82843 The angle is: -135

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!