Intersection of Two Lines Calculator
Find the point where two lines cross from y = mx + c or Ax + By = C, with the angle between them and a check, or learn if they are parallel or identical.
Intersection of Two Lines Calculator
Background.
The point where two straight lines cross is the one pair of values that satisfies both equations at once, and a surprising number of practical questions come down to finding it. Two pricing plans, one charging 20 plus 2 per unit and the other 50 plus 0.5 per unit, cost the same where y = 2x + 20 meets y = 0.5x + 50: at 20 units, when both come to 60. Break-even charts, supply and demand lines, and the corners of a linear-programming region are all the same calculation.
Two lines in a plane can do only three things. They cross once, they run parallel and never meet, or they are the same line written two ways. The calculator tells you which, and in the last two cases it says so in words rather than returning a number, because no solution and infinitely many solutions are different answers. Textbooks call those systems inconsistent and dependent.
Lines can be entered as y = mx + c or as Ax + By = C. Slope-intercept form is the one most algebra courses use, but it cannot describe a vertical line such as x = 3, which has no slope; standard form handles it by setting B to zero. Slope-intercept entries are rewritten internally as mx − y = −c, so both forms run through the same solver and agree for any line both can express.
What is intersection of two lines calculator?
The intersection of two lines is the set of points lying on both. Since a point lies on a line exactly when its coordinates satisfy the line's equation, finding the intersection is the same as solving a system of two linear equations in two unknowns. Writing both lines as A₁x + B₁y = C₁ and A₂x + B₂y = C₂, a single crossing exists precisely when the determinant A₁B₂ − A₂B₁ is not zero. When it is zero the lines point in the same direction, and they are either parallel and distinct, with no common point, or the same line, with every point in common.
How to use this calculator.
- Choose the form your equations are in. Use standard form if either line is vertical.
- In slope-intercept mode, enter each line's slope m and y-intercept c. The standard-form fields are ignored.
- In standard mode, enter A, B and C for each line after moving every x and y term to the left: 3y = 6 − 2x becomes 2x + 3y = 6. A vertical line x = 3 is A = 1, B = 0, C = 3; a horizontal line y = −2 is A = 0, B = 1, C = −2.
- Read the crossing point, or the message saying the lines are parallel or identical.
- Confirm the answer with the two check values, which should equal C₁ and C₂. In slope-intercept mode those are −c₁ and −c₂, because of the internal rewrite.
The formula.
The solver uses Cramer's rule. With D = A₁B₂ − A₂B₁, the coordinates are x = (C₁B₂ − C₂B₁) ÷ D and y = (A₁C₂ − A₂C₁) ÷ D, the elimination method written as determinants. When D = 0 the normal vectors (A₁, B₁) and (A₂, B₂) are parallel, so the lines are too. If the two numerators are also zero, one equation is a multiple of the other and they describe the same line; otherwise the lines never meet. The angle comes from the normals: cos θ = |A₁A₂ + B₁B₂| ÷ (√(A₁² + B₁²) × √(A₂² + B₂²)). The absolute value makes θ the acute angle, between 0° and 90°, whichever way round each equation is written. The more familiar slope formula, tan θ = |(m₂ − m₁) ÷ (1 + m₁m₂)|, divides by zero for perpendicular lines and has nothing to work with when a line is vertical; the normal-vector version has neither gap. Perpendicularity is the exact test A₁A₂ + B₁B₂ = 0, which is the same as m₁m₂ = −1 when both slopes exist. The size of D depends on how each equation happens to be scaled, so only whether it is zero carries geometric meaning.
A worked example.
Find where y = 2x + 1 and y = −x + 7 cross. Rewritten in standard form they are 2x − y = −1 and −x − y = −7, so A₁ = 2, B₁ = −1, C₁ = −1 and A₂ = −1, B₂ = −1, C₂ = −7. The determinant is D = 2 × (−1) − (−1) × (−1) = −2 − 1 = −3, which is not zero, so there is one crossing. For x: (C₁B₂ − C₂B₁) = (−1)(−1) − (−7)(−1) = 1 − 7 = −6, and −6 ÷ −3 = 2. For y: (A₁C₂ − A₂C₁) = 2 × (−7) − (−1)(−1) = −14 − 1 = −15, and −15 ÷ −3 = 5. The lines cross at (2, 5). Substituting back, 2(2) − 5 = −1 and −2 − 5 = −7, matching C₁ and C₂. For the angle, the normals (2, −1) and (−1, −1) have a dot product of −2 + 1 = −1 and lengths √5 and √2, so cos θ = 1 ÷ √10 = 0.3162 and θ = 71.5651°. The slope formula agrees: |(−1 − 2) ÷ (1 − 2)| = 3, and arctan 3 = 71.5651°.
Frequently asked questions.
How do I enter a vertical line such as x = 3?
What happens if the lines are parallel, or are the same line?
Why do the check values show −1 and −7 instead of my intercepts?
Why did the determinant change when I rewrote one equation?
My lines should be perpendicular, so why does the flag read 0?
Why does the crossing point jump around when the lines are nearly parallel?
References& sources.
- [1]OpenStax. College Algebra 2e, §7.1 "Systems of Linear Equations: Two Variables" — the three outcomes for a two-variable linear system (one solution, no solution / inconsistent, infinitely many / dependent) and the substitution and elimination methods. Open access.
- [2]Dawkins, Paul. "Linear Systems with Two Variables." Paul's Online Math Notes, Lamar University Department of Mathematics — worked elimination and the geometric reading of the three cases. Open access.
- [3]Weisstein, Eric W. "Line-Line Intersection." MathWorld — Wolfram Research. The determinant form of the two-line intersection point. Retrieved 2026-07-29.
- [4]Cramer, Gabriel. Introduction à l'analyse des lignes courbes algébriques. Geneva: Frères Cramer & Cl. Philibert, 1750, Appendix I — the original statement of the determinant rule for solving linear systems. Bibliographic reference; not retrieved during authoring.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 4 cited below
- Method
- x = (C₁B₂ − C₂B₁) ⁄ D · y = (A₁C₂ − A₂C₁) ⁄ D · D = A₁B₂ − A₂B₁ · cos θ = |A₁A₂ + B₁B₂| ⁄ (‖n₁‖‖n₂‖)
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled