If you have a graph with a line and you want the equation which represents this line.
You can choose 2 points along the line.
For instance.
These points have coordinates (x1,y1) and (x2,y2).
By means of their values we can compute the slope m of the line.
Remember that, the general straight line equation is
where m is the slope and b the y-intercept. The slope formula is
For instance, lets suppose that
hence, the slope is
and the equation for this particular case is
the only thing to find is the y-intercept b. This b can be computed by using one of the 2 points.
For instance, if we take point (1,3) in our example, and subtitute the coordinates into the above formula, we have
and by means of this, we can find b:
and finally, the line equation wiil be