Question: Create a library with following functions (prototypes are given along with a description): - double dist (double x1, double y1, double x2, double y2); //

Create a library with following functions (prototypes are given along with a description):
- double dist (double x1, double y1, double x2, double y2); // Finds the distance between two points with coordinates (x1, y1) and (x2, y2), and returns the result.
- double slope (double x1, double y1, double x2, double y2); // Finds the slope of the line with end points (x1, y1) and (x2, y2), and returns the result.
- double angle (double x1, double y1, double x2, double y2); // Finds the angle (in degrees) that the line joining the two points makes with the x-axis.
Use the library in a program where the user is asked to enter the x and y coordinates of two points. The program calls all three functions above and outputs the results. Hint: for the angle, you can use inverse tangent of abs(y2-y1)/abs(x2-x1) where abs is the absolute value function from the library. Include the library in your own library .cpp file. Do not just output numbers. Show a message with each result.

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!