Line passing through three points
Answers
Answer:
You need only two points. You don't have enough degrees of freedom for the third point. If you have two points, the line is already determined, the third point is either on the line or it isn't, you can't choose that.
How to get an equation for a line which passes through two points?
Well, start with the general form for a linear equation y = kx + n
We know that both points need to satisfy this equation when you plug their x coordinate as x and their y coordinate as y. Let first point be (x1, y1) and second point be (x2, y2).
Then you can get k from the equation y = kx + n in a following way:
Since y2 = kx2 + n and y1 = kx1 + n we have
y2 - y1 = kx2 + n - (kx1 + n)
y2 - y1 = kx2 + n - kx1 - n
y2 - y1 = k(x2 - x1)
k = (y2 - y1) / (x2 - x1)
Now, you can get the n by plugging the number k, as well as x and y coordinates of one of the points into the equation y = kx + n. Let's say you choose to plug coordinates of the point number one.
y1 = kx1 + n
n = y1 - kx1
Now you know n and voilà, that's your equation. It is in a form y = kx + n and I have just showed you how to calculate k and n.
Here’s an example.
You have points (1, 3) and (2, 7).
That means
x1 = 1
y1 = 3
x2 = 2
y2 = 7
k = (y2 - y1) / (x2 - x1) = (7 - 3) / (2 - 1) = 4
k = 4
n = y1 - kx1 = 3 - 4*1 = 3 - 4 = - 1
n = - 1
y = kx + n, k = 4, n = - 1