Given two coordinates, Print the line equation
Objective: Given two coordinates (x1, y1) and (x2, y2). Write a java program to construct a line equation that passes through the given coordinates.
Given two coordinates (x1, y1) and (x2, y2) the line equation is y - y1 = m(x - x1) where m is the slope of the line, where slope = (y2-y1)/(x2-x1)
Given coordinates: [3,7] and [5,11] Line Equation: y = 2x + 1 Given coordinates: [2,2] and [4,12] Line Equation: y = 5x -8
Given coordinates: [2,2] and [4,12] Line Equation: y = +5x -8
Top Companies Interview Questions..-
If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment.