Let l be a line in the x-y plane. If l is a vertical line, its equation
Question:
Let l be a line in the x-y plane. If l is a vertical line, its equation is x = a for some real number a . Suppose l is not a vertical line and its slope is m . Then the equation of l is y = mx + b , where b is the y -intercept. If l passes through the point ( x 0 , y 0 ,), the equation of l can be written as y – y 0 = m ( x – x 0 ). If ( x 1 , y 1 ) and ( x 2 , y 2 ) are two points in the x-y plane and x 1 ≠ x 2 , the slope of the line passing through these points is m = ( y 2 – y 1 ) / ( x 2 – x 1 ). Write a program that prompts the user to enter two points in the x-y plane. The program outputs the equation of the line and uses if statements to determine and output whether the line is vertical, horizontal, increasing, or decreasing. If l is a nonvertical line, output its equation in the form y = mx + b .