Docsity

Line-line Intersection, Summaries of Calculus

Toggle sidebar
bg1
Line-line Intersection
Ahmed Eldawy
Given two straight lines, each represented by two points, there are three
possible cases:
1. The two lines are parallel and disjoint. They do not intersect or they
intersect in infinity.
2. The two lines are parallel and overlapping. Their intersection is a straight
line equal to any of them.
3. The two lines are not parallel. They intersect in a single point.
The following derivation shows how to easily find out which case applies to
the two lines and find their intersection point if they intersect in a point.
First, let us assume that the first line S1is represented by two points p1and
p2. Similarly, the second line S2is represented by two points p3and p4. Each
point piis represened by two coordinates (xi, yi). Let us also assume that the
intersection point is p0.
We define the following vectors:
a=−−→
p1p2=p2−p1= (x2−x1, y2−y1)
b=−−→
p1p0=p0−p1= (x0−x1, y0−y1)
c=−−→
p3p4=p4−p3= (x4−x3, y4−y3)
d=−−→
p3p0=p0−p3= (x0−x3, y0−y3)
Since the intersection point p0is on the first line, we have
||a×b|| = 0
(x2−x1)(y0−y1)−(x0−x1)(y2−y1)=0
(x2−x1)y0+ (y1−y2)x0=y1x2−x1y2(1)
Similarly, since the intersection point p0is on the second line, we have
||c×d|| = 0
(x4−x3)(y0−y3)−(x0−x3)(y4−y3)=0
(x4−x3)y0+ (y3−y4)x0=y3x4−x3y4(2)
1
pf3

Partial preview of the text

Download Line-line Intersection and more Summaries Calculus in PDF only on Docsity!

Line-line Intersection

Ahmed Eldawy

Given two straight lines, each represented by two points, there are three

possible cases:

  1. The two lines are parallel and disjoint. They do not intersect or they

intersect in infinity.

  1. The two lines are parallel and overlapping. Their intersection is a straight

line equal to any of them.

  1. The two lines are not parallel. They intersect in a single point.

The following derivation shows how to easily find out which case applies to

the two lines and find their intersection point if they intersect in a point.

First, let us assume that the first line S 1 is represented by two points p 1 and

p 2. Similarly, the second line S 2 is represented by two points p 3 and p 4. Each

point pi is represened by two coordinates (xi, yi). Let us also assume that the

intersection point is p 0.

We define the following vectors:

a =

p 1 p 2 = p 2 − p 1 = (x 2 − x 1 , y 2 − y 1 )

b =

p 1 p 0 = p 0 − p 1 = (x 0 − x 1 , y 0 − y 1 )

c =

p 3 p 4 = p 4 − p 3 = (x 4 − x 3 , y 4 − y 3 )

d =

p 3 p 0 = p 0 − p 3 = (x 0 − x 3 , y 0 − y 3 )

Since the intersection point p 0 is on the first line, we have

||a × b|| = 0

(x 2 − x 1 )(y 0 − y 1 ) − (x 0 − x 1 )(y 2 − y 1 ) = 0

(x 2 − x 1 )y 0 + (y 1 − y 2 )x 0 = y 1 x 2 − x 1 y 2 (1)

Similarly, since the intersection point p 0 is on the second line, we have

||c × d|| = 0

(x 4 − x 3 )(y 0 − y 3 ) − (x 0 − x 3 )(y 4 − y 3 ) = 0

(x 4 − x 3 )y 0 + (y 3 − y 4 )x 0 = y 3 x 4 − x 3 y 4 (2)

Now, to find the values of the two unknowns x 0 and y 0 , we need to solve the

two linear equations 1 and 2. We use Cramer’s rule as follows.

D =

x 2 − x 1 y 1 − y 2

x 4 − x 3 y 3 − y 4

Dy 0

y 1 x 2 − x 1 y 2 y 1 − y 2

y 3 x 4 − x 3 y 4 y 3 − y 4

Dx 0 =

x 2 − x 1 y 1 x 2 − x 1 y 2

x 4 − x 3 y 3 x 4 − x 3 y 4

Finally, we find the unknowns x 0 = |Dx 0 |/|D| and y 0 = |Dy 0 /|D|.

The three cases described above will map to the following cases:

  1. If |D| = 0 and |Dx 0 | 6 = 0 and Dy 0 6 = 0, it indicates that the equations

have a solution at infinity which means that the two lines are disjoint and

parallel (they intersect at infinity).

  1. If |D| = 0 and |Dx 0 | = 0 and Dy 0 = 0, it indicates that the equations have

infinite number of solutions which means that the two lines are coincident.

  1. If |D| 6 = 0 it indicates a single solution to the equations which means that

the two lines intersect at a single point.

Example 1:

p 1 = (2, 0), p 2 = (0, 1), p 3 = (0, 0), p 4 = (1, 4)

D =

|D| = 9

Dx 0

|Dx 0 | = 2

Dy 0

|Dy 0 | = 8