# How can I get a equation of slope? [closed]

Here are two $x$,$y$ coordinates: $(2,2)$ ,$(4,3)$. And I want to know if I choose $x$ between above coordinate. How can I know the $y$?

As I know a slope of line equation is like this. $$y= mx+b$$

So if I apply the coordinate into above equation. $$m= \dfrac{3-2}{4-2} = \dfrac{1}{2}$$ $$b= 2$$ $$y= \dfrac{1}{2} x + b$$

So if I choose $x$ to be $4$ then I can get a value $4$ not $3$. I don't know how to resolve this problem.

• Your $b=1$. Check it.. – Oliver Jun 11 '15 at 4:11
• You kidding, right? This is not a DSP question. – jojek Jun 11 '15 at 8:11
• Hmm I don't think so. Becuase my question is from DSP expriment. – gmotree Jun 11 '15 at 13:10
• And that obviously doesn't make it fit to the DSP SE. – jojek Jun 11 '15 at 15:28
• I'm voting to close this question as off-topic because it is a general question about simple mathematics. – JRE Jul 15 '15 at 9:27

Your $b$ is wrong. Take a look here. The form $y=mx+b$ is called Slope-Intercept form where $b$ is the intersection with the y-axis (which is 1 in your case). You should use the two-point form: $$y - y_1 = \frac{y_2 - y_1}{x_2 - x_1} (x - x_1)$$
which yields $$y - 2 = \frac{1}{2} (x - 2)$$ or $$y = \frac{1}{2} x + 1$$