Associated Topics || Dr. Math Home || Search Dr. Math

### Finding Point of Intersection

```
Date: 05/08/2001 at 10:29:22
From: Ernst
Subject: Formula to test if two lines cross

I have two lines given by their coordinates. Is there a formula to
tell if the lines cross, and at what coordinates they cross?
```

```
Date: 05/08/2001 at 11:02:36
From: Doctor Ian
Subject: Re: Formula to test if two lines cross

Hi Ernst,

If you're dealing with Euclidean space, any two lines that aren't
parallel will cross somewhere, so you can compare the slopes of the
lines to find out whether they are parallel.

Once you know THAT they intersect, to find out WHERE they intersect
you need to solve a system of two equations with two variables, just
as you did back when you were answering questions like "The width of a
pool is three times its length; if the perimeter is 49 feet, how wide
is the pool?"

In other words, you have:

y = m1*x + b1

y = m2*x + b2

If you subtract one equation from the other, you get:

y - y = m1 x + b1 - m2 x - b2

0 = (m1 - m2)x + (b1 - b2)

You can solve this for x, and then use the value of x to find the
value of y at the point of intersection.

or if you have any other questions.

- Doctor Ian, The Math Forum
http://mathforum.org/dr.math/
```

```
Date: 05/09/2001 at 03:11:21
From: Ernst Naude
Subject: Re: Formula to test if two lines cross

I don't understand the formula. What are m and b?

I have 2 lines; the first line has points whose coordinates are:

(x1,y1) = (15,20)   and   (x2,y2) = (100,200)

and second line has points whose coordinates are:

(x3,y3) = (210, 5)   and   (x4,y4) = (23, 119)

If I draw it on the screen I see that the lines cross at point
(74,146). How do I work it out algebraically?
```

```
Date: 05/09/2001 at 14:02:06
From: Doctor Ian
Subject: Re: Formula to test if two lines cross

Hi Ernst,

Let me show you what I'm talking about with a different example.
Suppose I have one line containing the two points:

A = (1,4)    and   B = (50,102)

and another line containing the two points:

C = (5,10)   and   D = (10,-5)

To get from A to B, I have to move 48 units to the right, and 98 units
up. So the slope of the line is:

change in y     98
m = ------------- = ---- = 2
change in x     49

So I can write the equation of the line as:

y = mx + b

= 2x + b

What is this 'b'? Well, the line must cross the y-axis at the point
(0,b). To find b, we can substitute the values at some point on the
line:

y = 2x + b

4 = 2(1) + b

4 = 2 + b

2 = b

So the equation of the line is y = 2x + 2. This is a nice equation to
have, because we can plug in any value of x and get the corresponding
value of y. Let's check it for the two points we already know:

y = 2(1) + 2 = 4

so (1,4) is on the line.

y = 2(50) + 2 = 102

so (50,102) is on the line.

And we can generate as many other points as we want:

y = 2(12) + 2 = 26

so (12,26) is on the line.

y = 2(21.3) + 2 = 44.6

so (21.3,44.6) is on the line.

And so on. We can do the same analysis for the second line:

change in y     -5 - 10     -15
m = ------------- = --------- = ----- = -3
change in x     10 - 5       5

Note that you can make either point the 'starting' point:

change in y     10 - -5     15
m = ------------- = --------- = ----- = -3
change in x      5 - 10     -5

You get the same answer either way. (Do you see why?)

For the second line, the intercept is:

y = -3x + b

10 = -3(5) + b

10 = -15 + b

15 = b

So the equation of the second line is y = -3x + 25.

Now we can subtract these two equations, as I described earlier:

y - y = m1*x + b1  - m2*x - b2

0 = (2 - -3)x + (2 - 25)

0 = 5x - 23

x = 23/5

and

y = 2x + 2

= 2(23/5) + 2

= 46/5 + 2

= 56/5

So the point of intersection is (23/5, 56/5).

We can verify that the point is on both lines:

56/5 = 2(23/5) + 2

= 46/5 + 10/5

= 56/5

and

56/5 = -3(23/5) + 25

= -69/6 + 125/5

= 56/5

If you follow the same steps with your own problem, you should be able
to find the point of intersection for your two lines.

I hope this helps. If you get stuck, write back, and let me see the

- Doctor Ian, The Math Forum
http://mathforum.org/dr.math/
```
Associated Topics:
High School Basic Algebra
High School Equations, Graphs, Translations

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search