Angle Between Lines Calculator
How Sharply Do Two Lines Cross?
Any two non-parallel lines on a plane cross at some angle between 0° and 90° (measured as the smaller of the two angles formed). That angle depends only on the lines' slopes — not on where they happen to sit — which makes it possible to compute directly from the slope values or from direction vectors, without ever plotting the lines.
The Formula
From two slopes:
θ = atan(|(m2 − m1) / (1 + m1×m2)|)
If 1 + m1×m2 = 0, the lines are perpendicular and the angle is exactly 90°. From two direction vectors instead, the angle comes from the dot product:
θ = acos((v1·v2) / (|v1|×|v2|))
Worked Examples
| Slope m1 | Slope m2 | Angle |
|---|---|---|
| 1 | 2 | 18.4349° |
| 2 | 3 | 8.1301° |
| 1 | −1 | 90° (perpendicular) |
| 0.5 | −2 | 90° (perpendicular) |
The last two rows are perpendicular pairs — notice each m2 is the negative reciprocal of m1.
Where This Matters
- Roof pitch and framing — checking the angle between a rafter line and a ridge or wall line.
- Road and rail design — measuring the deflection angle where one alignment meets another.
- Vector physics — the direction-vector mode gives the angle between two velocities, forces, or displacements directly.
How to Use This Calculator
- Choose the input mode: From Two Slopes or From Two Direction Vectors.
- For slopes, enter Line 1 Slope (m1) and Line 2 Slope (m2).
- For vectors, enter Vector 1 X, Vector 1 Y, Vector 2 X, and Vector 2 Y.
- Select Calculate to see the angle between the two lines in degrees.
Related Calculations
Build the two lines first with the Line Equation Calculator, or find where they cross with the Intersection of Lines Calculator.