If you have 2 points, for example:

P( 2, 1 ); Q( 5, 7 )

You can find the linear equation of the line that passes through those points in the form:

Ax + By + C = 0

in one step by simply using the formula:

(y_{1} – y_{2})x + (x_{2} – x_{1})y + (x_{1}y_{2} – x_{2}y_{1}) = 0

OR, we can write this as (easier to read!)

(p_{y} – q_{y})x + (q_{x} – p_{x})y + (p_{x}q_{y} – q_{x}p_{y}) = 0

Let’s try it:

Take Point1=( 2, 1 )

Take Point2=( 5, 7 )Find the LINEAR EQUATION of the line that passes through the points (2,1) and (5,7). Your answer must be in the form of Ax + By + C = 0.

Using the equation:

(y_{1}– y_{2})x + (x_{2}– x_{1})y + (x_{1}y_{2}– x_{2}y_{1}) = 0We’ll just plug numbers in:

(1 – 7)x + (5 – 2)y + ( (2 x 7) – (5 x 1) ) = 0

-6x + 3y + (14 – 5) = 0

-6x + 3y + 9 = 0Factoring a -3 out:

-3( 2x – y – 3 ) = 0Dividing both sides by -3:

2x – y – 3 = 0And that’s the answer.

That’s hella shorter than having to go through and do it using y = mx + b, and its a systematic way to do it in a computer in case m is infinity.

Formula from Peter Shirley’s CG book

## 44 Comments

ive been given the following question :

the general equation of a straight line is ax+by+c=0.

Find the gradient of the line and the y intercept.

but i have been given no cooridinets to input into the equation so how am i supposed to work it out?

im thinking that since there are no coordinates to put in, the teacher wants just the letter and variable. If you switch this equation into “y=mx+b”, then it would look like “By=Ax+C”. So Ax is the slope, and C is the y-intercept. Thats how we learned it the other day.

you can also use:

y-y1= ((y2-y1)/(x2-x1))*(x-x1)

it is much easier !!

lorin, expand that out and see what you get :P

this is a math project i don’t know how to do it.

The simplest mathematical model to use to represent a set of real-life data is the line. The number of married couples in the United States in 1996 was 53.6 million. In 2002, the number of married couples grew to 56.7 million.

a. Write a linear equation that gives the number of married couples in terms of the year. Let x represent the year with x=6 corresponding to 1996.

b. What is the slope of the line.

c.What does the slope of the line tell you about the married couples in the united states.

Please help Thank you so much.

What if the equation doesn’t have a LCD, then what do you do?

thanks, you were a huge help

it dosent mentions about what the parameteres A B and C stands for.not so helpful for a new man who starts to learn this

Hey.It doesn t work all the time cuz we can`t always factor ;P!Example:L(-1,-3) and M(4,7)

If you can demonstrate it…I mean I can…okay,sorry for this unneccesary comment.

thank u po

You could use this too..

P( 2, 1 ); Q( 5, 7 )

Rc y2-y1/x2-x1= m

Rc 7-1/5-2= 6/3= 2

Rc= m

Rc= 2

y-y1=m(x-x1)

y-1=2(x-2)

y-1=2x-4

y=2x-4+1

y=2x-3 (y=mx+q)

so -2x+1y+3=0 (ax+by+c=0)

I think this is a little bit shorter :P

I go a little bit further but i can’t tell this in english.

-2x+1y+3=0

The x = -2x+1*0+3=0

-2x+3=0

-2x=-3

x=-3+2

x=-1

The y = -2*0+1y+3=0

y+3=0

y=-3

If you have this formula: x=p not this one y=mx+q then you have no y

if you have y=0x+q then you have no x

then you write impossible

Greetz Kinvaris

Thanks… but how does it work?

I have co-ordinates for P and Q.

AX + BY + C = 0 passing through both P and Q implies that:

A * P.X + B * P.Y + C = 0 and

A * Q.X + B * Q.Y + C = 0

That’s two equations!! And three unknowns!!! How do we solve this?

I’m sure it works. I wanted to know how it works.

thank you so much! this really helped out a lot :)

Ax+By+C=0!!

ok so we got this big packet that we have to finish by the end of the week…ok so iv’e got everything except for one question…i cant turn mx + b =y form into ax + by = c formm…pleese help…!!!!

It’s Ax + By = C not something something something c = 0.

F**ing morons.

Hey Gavin,

Just move the C to the left side.

im still stuck on this…

A straight line passes through (2,1) and (5,7). Find its equation in the form ax+by+c=0

i can get up to y2-y1/x2-x1 which is

7-1/5-2 which is 6/3 and i know u leave it there. now what do i do!!

I can plug in this formula in some of my problems and i get the numbers but they are the wrong signs, as far as neg or pos. So you need negs in the front of the ( for each. Thanks please make the corrections so you dont throw others off as you did me.

@Math tutor just multiply both sides by (-1).

What? Where did you get -3 from..?

On the 2nd last step, I just noticed that 3, is the biggest number I can evenly factor out of -6x + 3y + 9, and I used (-3) because I wanted the x factor to be +2, not -2.

In the last step, as a general rule you can multiply both sides of an equation by any number you want. Could have been 9000 if you want.

So on the LEFT, that (-3) in front, gets divided by (-3), leaving just 1 in front of that bracket on the LEFT side. On the RIGHT side, 0 divided by -3 is still 0.

Hi Buddy,

Can you help me with this question please? I am stuffed!

http://gis.stackexchange.com/questions/19235/find-point-c-by-having-two-points-such-as-a-and-b

wew ang baba naman ng mga rason niyo!!!!!

Mathematics are at times complicated, for weak BRAINS…

But for Math Wizards, It’s just a piece of cake!!!

~iGothic

grangrfazsbgr sf<3 fatalloveee<3333

wow how gay is this i have been lookin all over for this and there it is simple and easy

what if you have negitive numbers in the points idk how to figure it out

please help!!!!!!!!!!!!!!!!

nka2long to, sobra!! ^_^ all of u, do u understand what i said?

:P

Why don’t you demonstrate the proof of the formula? You only give the formula, why don’t you tell us how you got it?

Thanks

y-y1=m(x-x1)

ax+3y+5=0 and 4x-y-9=0 equal lines Count a

can someone please tell me when we use AB = √(x2-x1)^2 + (y2-y1)^2 (that’s all under one root btw) and give an example?

cheers

The explanation is actually wrong you should divide both sides to cancel out A

Hi, when putting an answer in the form ax + by + c = 0, are there always two possible answers?

e.g. an answer could be 5x – 4y – 6 = 0, but could I also give -5x + 4y + 6 = 0 as an answer?

Thank you for your help!

Best way to solve this problem is by Using Formula for 2 points Y-Y1/Y1-Y2 = X-X1/X1-X2

Two points are (2,1) and (5,7) i.e (X1,Y1) and (X2,Y2) Respectively

Substitute as Y-1/1-7 = X-2/2-5 ie Y-1/(-6) = X-2/(-3)

Cross Multiplying we end up as follows

-3Y+3 = -6X+12

-3Y = -6X+9

Y = 2X+3

What if my c is on the other side of the = sign (AX+BY=C), Would I do the opposite with the factoring on the C side than I would do on the equation side?

I answered my own question. Yes you would

What is an=x+7bc_ac=2x+4

Such an easy explanation compared to what im given in class. Super helpful!

Thank you for teaching me an entire Mathematics topic in 5 minutes!

## One Trackback/Pingback

[…] This is a bit of linear algebra derived from the general equation for a line. […]