Serlo Logo The Open Learning Platform

Computing the Intersection of Two Lines

Two different straight lines that lie in a plane and are not parallel always have an intersection point.

Schnittpunkt zweier Geraden

Given are usually two linear functions f and g with the general equations of the straight line:

  • f(x)=m1x+t1 and

  • g(x)=m2x+t2 .

We are looking for the intersection point S(a|b).

For this point S(a|b), it holds that

f(a)=g(a)=b

Example

Consider the following linear functions:

  • f(x)=3x+2

  • g(x)=2x+5.

Calculate the intersection point.

Set the functions equal and bring x to one side of the equation:

f(x)=g(x)3x+2=2x+5|23x=2x+3|2xx=3

The function value of f and g are therefore equal at x=3. The point of intersection of the two lines is therefore at S(3|?).

You can now calculate the missing y-value by plugging x=3 into f(x) or g(x). It doesn't make any difference which of both you choose, since according to the calculation above f(3)=g(3).

x=3 plugged into f(x) yields:

f(3)=33+2=9+2=11

The intersection point is therefore at S(3|11).

General procedure

You set the two functions equal and bring x to one side of the equation.

f(x)=g(x)m1x+t1=m2x+t2|t1m1x=m2x+(t2t1)|m2xm1xm2x=t2t1(m1m2)x=t2t1|:(m1m2)x=t2t1m1m2

The x-value of the intersection point is therefore at x=t2t1m1m2.

Now plug x=t2t1m1m2 into f(x) or g(x) to get the y-value of the intersection point:

f(x)=m1x+t1
f(t2t1m1m2)=m1t2t1m1m2+t1y-value of the intersection

The intersection point of the lines is therefore S(t2t1m1m2|m1t2t1m1m2+t1).


This content is licensed under
CC BY-SA 4.0 What does that mean? serlo.org