C++ code to create various functions and perform manipulations.
Write a modular program, spFunctionsHWlines.cpp, with functions to perform the following:
bool areParallel(parameter list as described) This function will return true if two lines, each line defined by two points, are parallel; otherwise, it will return false.
bool arePerpendicular(parameter list as described) This function will return true if two lines, each line defined by two points, are perpendicular; otherwise, it will return false.
double calculateDistance(parameter list as described) This function will calculate and return the distance between two points.
bool areCoinciding(parameter list as described) This function will return true if two lines, each line defined by two points, are coinciding (the same line); otherwise, it will return false.
bool calculateIntersection(parameter list as described) This function will return true if two lines, each line defined by two points, intersect; otherwise, it will return false. If the two lines intersect, the point at which they intersect should be passed back to the calling function via reference parameters.
void calculateMidpoint(parameter list as described) This function should calculate the midpoint of a line segment defined by two points. Since the midpoint consists of two values, these values should be passed back to the calling function via reference parameters.
bool calculateSlope(parameter list as described) This function will return true if the slope of a line, defined by two points, is defined; otherwise, it will return false. If the slope is defined, the slope should be passed back to the calling function via a reference parameter.
double calculateYIntercept(parameter list as described) This function will return the y-intercept of a line given one point on the line and the slope of the line. The standard equation of a line is y = mx + b where b is the y-intercept.
void displayEquationOfLine(parameter list as described) This function will display the two points and the equation of a line, defined by two points, to the screen in the standard format, y = mx + b, where m is the slope and b is the y-intercept.
void getPoint(parameter list as described) This function should get a point, (x, y), from the user and pass the values for both x and y back to the calling function using reference parameters.
The points could contain decimal values which means the variables storing these values should be of type double. Recall that floating-point numbers should not be compared using the == relational operator; instead, use an epsilon comparison with a tolerance of 0.0000001.
All floating point values should be displayed to user with 1 decimal place.
When establishing parameter lists which include multiple points, students often implement an ordering of all the x values together followed by all of the y values, e.g. x1, x2, y1, y2. A better ordering would be to group the x and y values of a point together, e.g. x1, y1, x2, y2.