Two lines intersection calculator
▲
Line 1
Equation
x +
y +
= 0
2 points
(x
1
,y
1
)
(
)
(x
2
,y
2
)
(
)
Slope, Point
(x
p
,y
p
)
(
)
Slope =
Angle =
Line 2
Equation
x +
y +
= 0
2 points
(x
1
,y
1
)
(
)
(x
2
,y
2
)
(
)
Slope, Point
(x
p
,y
p
)
(
)
Slope =
Angle =
Angle between lines
Intersection point
x =
y =
Angle
Bisector
lines
Equations
Slopes
Angles
Degree
Radian
line geometry
Inclined lines
Two lines intersection
▲
Lines given by the equations:
y
=
m
1
x
+
a
y
=
m
2
x
+
b
Where in vector notation:
A
=
m
1
i - j
B
=
m
2
i − j
The intersection point is determined by solving the values of x and y from the two lines equations by
Cramer's rule
or by direct substitution:
If m
2
− m
1
= 0
then both lines are parallel.
The angle between two lines in the range
0 <
θ
<
π
/2
is:
The angle between the two lines can be calculated by
vector dot product
method: A · B
= |
A
| |
B
|cos
θ
Note:
the ± sign stands for the two possible angles between two lines that are complementary to
180
degrees.
If the two lines are given by the equations:
a
1
x
+
b
1
y
+
c
1
= 0
a
2
x
+
b
2
y
+
c
2
= 0
The intersection point is determined by solving the values of x and y from the two lines equations:
If a
1
b
2
− a
2
b
1
= 0 then both lines are parallel.
If both lines are each given by two points, first line points:
(
x
1
, y
1
) , (
x
2
, y
2
)
and the second line is given by two points:
(
x
3
, y
3
) , (
x
4
, y
4
)
The intersection point
(
x , y
)
is found by
the equations:
Example:
find the intersection point and the angle between the lines:
x −
2
y
+ 3 = 0
3
x +
4
y
+ 1 = 0
Solving the lines equations for x and y by Cramer's rule.
And the intersection point is at
(− 1.4 , 0.8)
The angle between the lines is:
If the two solutions are added then:
63.43 + 116.57 = 180
as we expected.
Two lines angle bisector
▲
Two lines bisector angle
Lines given by the equations:
y
=
m
1
x
+
a
y
=
m
2
x
+
b
The angle of the lines angle bisector from the x axis is:
The equation of the angle bisector line is:
First line:
A second angle bisector exists at a right angle from the first line.
Second line:
Where:
m
b
can be expressed by the slopes m
1
and m
2
of the lines as:
The ± sign stands for the two angle bisectors possible between two lines (complementary to 180 degree).
Angle bisector line equation expressed by m
1
and m
2
is:
y − y
0
=
m
b
(
x − x
0
)
If the lines are given by the equations:
a
1
x
+
b
1
y
+
c
1
= 0
a
2
x
+
b
2
y
+
c
2
= 0
The distance
(
d
)
of any common point
(
x , y
)
on the angle bisector between two lines are the same
(
two similar triangles
)
.
distance of point
(
x , y
)
from line
(1)
distance of point
(
x , y
)
from line
(2)
And the equation of the lines angle bisector is:
This equation can be written as:
(a
1
− φ a
2
)x + (b
1
− φ b
2
)y + (c
1
− φ c
2
) = 0
Where:
Note:
The Plus and minus sign is used to find the two possible angle bisectors lines equation which are
90
degrees apart.
Two lines angle bisector example
▲
Example:
given two lines:
3
x −
4
y
+ 2 = 0
5
x
+ 12
y
+ 1 = 0
find the angle between the lines and the equation of the angle bisector between the two lines.
The angle between the lines is found by
vector dot product
method.
We can write the lines general direction by vector notation as:
L
1
=
a
1
i
+
b
1
j and L
2
=
a
2
i
+
b
2
j
The dot product of these two vectors is related to the angle by the formula: L
1
· L
2
=
|
L
1
||
L
2
|cos
θ
Where:
L
1
· L
2
=
a
1
a
2
+
b
1
b
2
Then the two possible angles are:
In order to find the angle bisector line equation, we use the distance equations:
And the two lines angle bisector lines equation are:
13(3
x −
4
y
+2) = 5(5
x
+ 12
y
+ 1)
14
x −
112
y
+ 21 = 0
And the second line:
−
13(3
x −
4
y
+ 2) = 5(5
x
+ 12
y
+ 1)
64
x
+ 8y + 31 = 0
Example 3 - intersection of 2 lines each defined by 2 points
▲
Find the intersection point of two lines each of them defined by two pair of coordinates, first line by
(
x
1
y
1
)
(
x
2
y
2
)
and second line by
(
x
3
y
3
)
and
(
x
4
y
4
)
.
The equations of two arbitrary lines are: y = m
1
x + a and y = m
2
x + b
This equation can be easily solved by comparing the y values of both equations: m
1
x + a = m
2
x + b
And the solution is:
and
from the sketch the slope m
1
is:
the same solution for slope m
2
is:
The slope m
1
can be written as a function of x and y as:
or
And the line equation will be:
We can see that the free item that is a in the line equation is equal to
a = y
1
− m
1
x
1
and for the second line
b = y
3
− m
2
x
3
Now that we have found all the values of m
1
m
2
a and b, we can substitute those values to the x and y coordinate of the intersection point.
And the same process accompanied with some basic algebra steps we get the y coordinate:
Now substitute the values of m
1
and m
2
to get: