Let your function be given as $y= f(x) = ax+b$. Let $(x_1,y_1), (x_2,y_2)$ be distinct points (at least one of their coordinates differs). Then they uniquely define the line $f_l(x) =a_lx + b_l $, by the equations $y_1 = a_lx_1 + b_l$, $y_2 = a_lx_2 + b_l$. You get the solution: $a_l = (y_2-y_1)/(x_2-x_1)$ and $b_l = (y_1x_2-y_2x_1)/(x_2-x_1)$, if $x_2 = x_1$ you simply get a vertical line. Consider the expression for $a$, it's the same as $\tan \alpha = (y_2-y_1)/(x_2-x_1) = a$, where $\alpha$ is the angle between the line and the abscissa.
Let your function be given as $y= f(x) = ax+b$. Let $(x_1,y_1), (x_2,y_2)$ be distinct points (at least one of their coordinates differs). Then they uniquely define the line $f_l(x) =a_lx + b_l $, by the equations $y_1 = a_lx_1 + b_l$, $y_2 = a_lx_2 + b_l$. You get the solution: $a_l = (y_2-y_1)/(x_2-x_1)$ and $b_l = (y_1x_2-y_2x_1)/(x_2-x_1)$, if $x_2 = x_1$ you simply get a vertical line. Consider the expression for $a$, it's the same as $\tan \alpha = (y_2-y_1)/(x_2-x_1) = a$, where $\alpha$ is the angle between the line and the abscissa.