Intersection of Two Lines Calculator
The point where two lines meet and the angle between them. Enter the lines as y = mx + n, ax + by + c = 0 or by two points each. Parallel and coincident cases are flagged.
How do you find where two lines intersect?
The point of intersection lies on both lines, so it satisfies both equations. The task is to solve two equations in two unknowns.
If the lines are y = m₁x + n₁ and y = m₂x + n₂, set the right sides equal: x = (n₂ − n₁) / (m₁ − m₂). Put that x back into either equation to get y.
Example
For y = 2x + 1 and y = −x + 4, 2x + 1 = −x + 4 gives 3x = 3, so x = 1. Then y = 2 × 1 + 1 = 3. The lines meet at (1, 3).
Solving in general form
If the lines are a₁x + b₁y + c₁ = 0 and a₂x + b₂y + c₂ = 0, compute the determinant first: D = a₁b₂ − a₂b₁. Then x = (b₁c₂ − b₂c₁) / D and y = (a₂c₁ − a₁c₂) / D. This route also works for vertical lines.
Parallel and coincident lines
A zero determinant means the lines have the same slope. Either they are parallel and never meet, or they are the same line and share every point. For parallel lines the calculator also gives the perpendicular distance between them.
Angle between the lines
From the slopes, tan φ = |(m₁ − m₂) / (1 + m₁m₂)|. The lines are perpendicular when the product of the slopes is −1.
Do the segments actually cross?
When you enter each line by two points, the calculator also says whether the intersection falls between those points or on an extension. That is how you check whether two grid lines, two pipe runs or two beams really clash in plan.
Limits
The calculator handles lines in a plane. For nearly parallel lines the intersection lies far away and a small input error changes the result a great deal.
Related calculators
-
Geometry
Line Equation Calculator
Equation of a line from two points or from a point and a slope: y = mx + n, general form ax + by + c = 0, slope angle and axis intercepts. -
Geometry
Circle and Tangent Calculator
Length and touch points of the tangents from an outside point to a circle, where a line cuts a circle, and the position and common tangent lengths of two circles. -
Geometry
Angle from Three Points Calculator
The angle formed at the vertex by three points given as coordinates, in the plane and in space. Also gives the other angles, sides and area of the triangle. -
Geometry
Projection Calculator: Parallel and Perpendicular Components
Scalar and vector projection of one vector onto another, parallel and perpendicular parts, and the distance and foot of the perpendicular from a point to a line. 2D and 3D.
Found a mistake or something missing?
If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.