Line Intersection Calculator

Find where two lines given by A x + B y = C cross, with the x and y coordinates and the angle between them.

Math and PercentUpdated 2026-11-184 min read
Line Intersection Calculator
Coefficient of x in A x + B y = C.
Coefficient of y in A x + B y = C.
Intersection point (x, y)
...
x coordinate...
y coordinate...
Angle between the lines...

What it does

Two straight lines on a flat plane either cross once, run side by side forever, or lie on top of each other. This calculator takes the common general form A x + B y = C for each line and returns the single crossing point when one exists. It also reports the x and y coordinates separately and the acute angle at which the lines meet.

The general form is used because it copes with every line, including vertical ones such as x = 3 that have no slope in the usual sense. Writing a line as A x + B y = C only needs the three numbers A, B and C, and multiplying all three by the same factor gives the same line. OpenStax College Algebra presents the determinant method for solving exactly this kind of two equation system.

The calculation is Cramer's rule. Build the coefficient determinant D from A and B, then replace the x column with the constants to get Dx and the y column to get Dy. Dividing Dx and Dy by D gives the coordinates. The University of Dundee mathematics notes show the same idea from the slope intercept side, where a zero determinant lines up with equal slopes.

When D is zero there is no unique answer. If the constants follow the same ratio as the coefficients, the two equations describe one line and every point on it is a solution. Otherwise the lines are parallel and never meet. The tool tells you which case you have rather than dividing by zero.

The angle output comes from the direction vectors of the two lines, which for A x + B y = C point along (B, -A). Taking the absolute value of the dot product gives the smaller angle between the lines, so a pair of lines always reports a value between zero and ninety degrees.

How to use

  1. Write each line in general form A x + B y = C, moving the x and y terms to the left and the constant to the right.
  2. Enter A, B and C for the first line. At least one of A and B must be nonzero.
  3. Enter A, B and C for the second line in the same way.
  4. Read the intersection point and the separate x and y coordinates from the results.
  5. Check the angle output when the direction of the crossing matters as well as its location.
  6. If you get a message about parallel or identical lines, review the constants, because no single point exists in those cases.

Formula

For A1 x + B1 y = C1 and A2 x + B2 y = C2: D = A1 B2 - A2 B1, Dx = C1 B2 - C2 B1, Dy = A1 C2 - A2 C1, then x = Dx / D and y = Dy / D.
D
Determinant of the A and B coefficients. Zero means parallel or identical lines.
Dx
Determinant formed by replacing the x column with the constants C1 and C2.
Dy
Determinant formed by replacing the y column with the constants C1 and C2.
A1, B1, C1
The three numbers in the equation of the first line.
A2, B2, C2
The three numbers in the equation of the second line.
(x, y)
Coordinates of the point where the two lines cross.

Cramer's rule needs D to be nonzero. If D is zero while Dx or Dy is not zero, the lines are parallel and there is no solution. If D, Dx and Dy are all zero, the equations are multiples of one another and describe the same line, which has infinitely many points. The angle uses the direction vectors (B1, -A1) and (B2, -A2), taking the absolute dot product so the result is the acute angle between the lines.

Worked example

Example: where x + y = 10 meets 2x - y = 5

Defaults: line 1 has A = 1, B = 1, C = 10 and line 2 has A = 2, B = -1, C = 5.

  1. Coefficient determinant: D = A1 B2 - A2 B1 = (1)(-1) - (2)(1) = -1 - 2 = -3.
  2. Because D is not zero, the lines cross at exactly one point.
  3. Replace the x column: Dx = C1 B2 - C2 B1 = (10)(-1) - (5)(1) = -10 - 5 = -15, so x = -15 / -3 = 5.
  4. Replace the y column: Dy = A1 C2 - A2 C1 = (1)(5) - (2)(10) = 5 - 20 = -15, so y = -15 / -3 = 5.
  5. Check in both equations: 5 + 5 = 10 and 2(5) - 5 = 5.
  6. Direction vectors are (1, -1) and (-1, -2). Their dot product has size 1 and their lengths are sqrt(2) and sqrt(5), so the acute angle is arccos(1 / 3.162278) = 71.57 degrees.
  7. The tool shows (5, 5), x = 5, y = 5 and an angle of 71.57°.

Reference table

Crossing points and acute angles for three pairs of lines
Line 1Line 2IntersectionAngle
x + y = 102x - y = 5(5, 5)71.57°
y = 0x - y = -4(-4, 0)45°
x = 3y = -2(3, -2)90°

Limits

  • Covers straight lines in a flat plane only, not curves or lines in three dimensions.
  • Parallel lines have no single crossing point and identical lines have infinitely many, so both cases return a message instead of a coordinate.
  • Coefficient sizes above 1,000,000 are rejected to keep the determinants in a safe range.
  • The angle reported is always the acute angle between the lines, not a directed bearing from one line to the other.

Common mistakes

  • Mixing up the sign when moving a term across the equals sign into A x + B y = C.
  • Setting both A and B to zero for a line, which does not describe a line at all.
  • Reading a zero determinant as a fault rather than a signal that the lines are parallel or identical.
  • Comparing slopes directly when one line is vertical, instead of using the general form that handles x = constant.
  • Expecting one crossing point when the two equations are just multiples of each other.

Try it yourself

Quick checks. Answers sit tucked under each question.

Where do x + y = 7 and x - y = 1 cross?

Adding the equations gives 2x = 8, so x = 4 and y = 3. Cramer's rule agrees: D = -2, Dx = -8 and Dy = -6, giving the point (4, 3).

Find the crossing of 3x + 2y = 12 and x - y = 1.

D = 3(-1) - 1(2) = -5, Dx = 12(-1) - 1(2) = -14 so x = 2.8, and Dy = 3(1) - 1(12) = -9 so y = 1.8. The tool shows (2.8, 1.8).

What happens with 2x + y = 4 and 4x + 2y = 9?

D = 2(2) - 4(1) = 0 while Dx = 4(2) - 9(1) = -1, so the lines are parallel. There is no intersection and the tool returns an error message.

Questions

What is the point of intersection of two lines?

It is the single coordinate pair that satisfies both line equations at once, found by solving the two equations together.

Why use the general form A x + B y = C?

It handles vertical lines such as x = 3 that have no slope, and it leads straight to the determinant formulas of Cramer's rule.

What does a zero determinant mean?

It means the lines have the same direction. They are either parallel with no shared point, or identical with every point shared.

Can two lines cross more than once?

No. Distinct straight lines in a plane meet at most once. If they seem to share two points, they are actually the same line.

How is the angle between the lines found?

Each line has a direction vector (B, -A). The absolute dot product of the two vectors divided by their lengths gives the cosine of the acute angle.

Do I need to convert to slope intercept form first?

No. Enter A, B and C directly. The calculator works from the general form and needs no rearrangement beyond moving terms to the correct side.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.