2
$\begingroup$

In a straight line equation $y = mx + b$ if I have $m$ and $x$ how can I get $b$ (where the line cross the Y axis)?

I search on the internet they said to get it by drawing it and see where it cross the Y axis, and this not possible since the numbers am dealing with is very large.

  • 1
    How is that calculus?2012-10-30
  • 2
    Will you please share more information on the set-up of the problem? Typically $x$ is not a constant, so you do not "have" it. It is a variable. You may be given a particular pair $(x,y)$ that satisfies the equation in addition to $m$. Is that what you mean?2012-10-30
  • 1
    @Swaiss: Could you please give an example of what information you are given?2012-10-30
  • 0
    I am developing a geometry program, and i have straight line to get 'm' and i know exactly where x should be, i need y to complete the line to specific point, so to get 'y' i need to know where the line crosses the Y axis.2012-10-30
  • 1
    this is two points on the line am working on it: point 1 = (419445.4712 , 1683997.1179) point 2 = (419438.9394 , 1683999.5773)2012-10-30
  • 2
    @Swaiss: Your problem with two points is not what you described previously. Just knowing $m$ and a value of $x$ would not tell you much: Every value of $x$ will be part of a solution to an equation with a given $m$. But with two points, we're getting somewhere. If you know how to find $m$, and you also know a particular solution $(x,y)$, which can be given by either of your two points, plug in those three numbers into the equation $y=mx+b$ to leave $b$ as the only unknown, then solve. See also http://www.purplemath.com/modules/strtlneq.htm2012-10-30

1 Answers 1

2

It looks like you have two points $(x_1,y_1)$ and $(x_2,y_2)$ so you can set up two simultaneous equations

$$y_1=mx_1+b$$$$y_2=mx_2+b$$Multiply the first by $x_2$ and the second by $x_1$

$$y_1x_2=mx_1x_2+bx_2$$$$y_2x_1=mx_1x_2+bx_1$$subtract:$$y_1x_2-y_2x_1=b(x_2-x_1)$$ and go from there.

You might also like to investigate the form:$$y=y_1\frac{(x-x_2)}{(x_1-x_2)}+y_2\frac{(x-x_1)}{(x_2-x_1)}$$ which is a direct way of writing the equation of a line through two points. The form can be developed to give the equation of a quadratic through three points, and generally the lowest degree curve through $n$ points.

  • 1
    You could also get the slope $m$ from $m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1}$, and then use either equation to get $b$.2012-10-30