This is the standard formula you can use in this situation, just plug in the known numbers and arrange into the form you want such as y = mx + c
The formula above is just the cross multiplied version of
(y - y1) / (x - y1) = (y2 - x1) / (x2 - x1)
which equates the general case of the slope (LHS) with the slope as defined by the two given points (RHS) and is therefore true.
Depending on how much you think and worry about this stuff, It may not be obvious the formula contains enough information to give c, the y intercept since it only deals with the slope. But the fact that it uses the general case x and y means that the corresponding absolute values of x1 and y1 effectively include an understanding of the offset.
First, you take the difference of the x points and the difference of the y points. say its 3,5 and 4,7. the difference for the x would be one and the difference for the y would be 2. then you divide the y difference by the x difference. this is the slope. then, what i usually do to find where the line touches the y axis, i back track the x to 0. (4,7),(3,5),(2,3)(1,1),(0,-1). So it cross the y axis at -1. so the equation would be y=2x-1. (If it takes to long or is too hard to backtrack, theres an equation for it you can find online.)
Answers & Comments
The equation of a line is typically written as y = mx + b where m is the slope and b is the y-intercept.
-
Let points be A (a,b) and B (c,d)
Slope , m = ( d - b ) / ( c - a)
y - b = m ( x - a )
Example
Points (1,2) and (4,8)
m = (8 - 2) / (4 - 1) = 6/3 = 2
y - 2 = 2 ( x - 1 )
y = 2x
It's known as a straight line equation.
y=mx+c, m and c are constants. There are two unknowns. Therefore, you need two points. The number of unknown should be equal to the number of points.
(y - y1) / (y2 - y1) = (x - x1) / (x2 - x1)
This is the standard formula you can use in this situation, just plug in the known numbers and arrange into the form you want such as y = mx + c
The formula above is just the cross multiplied version of
(y - y1) / (x - y1) = (y2 - x1) / (x2 - x1)
which equates the general case of the slope (LHS) with the slope as defined by the two given points (RHS) and is therefore true.
Depending on how much you think and worry about this stuff, It may not be obvious the formula contains enough information to give c, the y intercept since it only deals with the slope. But the fact that it uses the general case x and y means that the corresponding absolute values of x1 and y1 effectively include an understanding of the offset.
How many dimensions are we talking about?
If in a plane, the slope is
(y2 - y1)/(x2 - x1),
so the equation is of the form
y = (y2 - y1)x/(x2 - x1) + b,
but then b must be
y1 + (y1 - y2)x1/(x2 - x1),
so the equation is
y = (y2 - y1)x/(x2 - x1) + y1 +
+ (y1 - y2)x1/(x2 - x1).
Simplify if you wish.
Let the points be (x1,y1) and (x2,y2). Then the equation of the line is
(y-y1)/(y1-y2) = (x-x1)/(x1-x2)
First, you take the difference of the x points and the difference of the y points. say its 3,5 and 4,7. the difference for the x would be one and the difference for the y would be 2. then you divide the y difference by the x difference. this is the slope. then, what i usually do to find where the line touches the y axis, i back track the x to 0. (4,7),(3,5),(2,3)(1,1),(0,-1). So it cross the y axis at -1. so the equation would be y=2x-1. (If it takes to long or is too hard to backtrack, theres an equation for it you can find online.)
The equation is (y-y1)/(y2-y1) = (x-x1)/(x2-x1)