TExcelTAD

Angle Between Two Lines

When two non-parallel straight lines intersect on a plane, they form four angles meeting at a single vertex. These angles consist of two vertically opposite pairs: one pair is acute (or right), and the other pair is obtuse (or right).

By universal mathematical convention, the angle between two lines φ\varphi is defined as the measure of the acute or right angle:

0∘≤φ≤90∘(0≤φ≤π2)0^\circ \le \varphi \le 90^\circ \quad \left(0 \le \varphi \le \frac{\pi}{2}\right)

If the lines are parallel or coincide, the angle between them is defined as φ=0∘\varphi = 0^\circ. In this lesson, we will master how to compute this angle with absolute precision on paper using both normal vectors and slopes.


1. Concepts & Geometric Derivation

Derivation via Normal Vectors

Let two lines be given in general form:

d1:A1x+B1y+C1=0with normal vector n⃗1=(A1,B1)d2:A2x+B2y+C2=0with normal vector n⃗2=(A2,B2)\begin{aligned} d_1 &: A_1 x + B_1 y + C_1 = 0 \quad \text{with normal vector } \vec{n}_1 = (A_1, B_1) \\ d_2 &: A_2 x + B_2 y + C_2 = 0 \quad \text{with normal vector } \vec{n}_2 = (A_2, B_2) \end{aligned}

Because each normal vector is strictly perpendicular to its respective line, the angle between the two lines equals the angle between their normal vectors (or its supplement):

Line d: Ax + By + C = 0 Normal n = (A, B) M0(x0, y0)

From the definition of the vector dot product:

n⃗1⋅n⃗2=∥n⃗1∥∥n⃗2∥cos⁡θ\vec{n}_1 \cdot \vec{n}_2 = \|\vec{n}_1\| \|\vec{n}_2\| \cos \theta

Depending on the directions of n⃗1\vec{n}_1 and n⃗2\vec{n}_2, the angle θ\theta might be acute (cos⁡θ>0\cos \theta > 0) or obtuse (cos⁡θ<0\cos \theta < 0). Because the angle between lines φ\varphi is defined to be acute, cos⁡φ\cos \varphi must be strictly non-negative (cos⁡φ≥0\cos \varphi \ge 0).

Placing an absolute value around the numerator guarantees this non-negative value:

cos⁡φ=∣n⃗1⋅n⃗2∣∥n⃗1∥∥n⃗2∥=∣A1A2+B1B2∣A12+B12A22+B22\cos \varphi = \frac{|\vec{n}_1 \cdot \vec{n}_2|}{\|\vec{n}_1\| \|\vec{n}_2\|} = \frac{|A_1 A_2 + B_1 B_2|}{\sqrt{A_1^2 + B_1^2} \sqrt{A_2^2 + B_2^2}}

Derivation via Slopes

If neither line is vertical, let their slopes be m1=tan⁡α1m_1 = \tan \alpha_1 and m2=tan⁡α2m_2 = \tan \alpha_2, where α1,α2\alpha_1, \alpha_2 are their angles of inclination.

Using the tangent subtraction formula from trigonometry:

tan⁡(α2−α1)=tan⁡α2−tan⁡α11+tan⁡α1tan⁡α2=m2−m11+m1m2\tan(\alpha_2 - \alpha_1) = \frac{\tan \alpha_2 - \tan \alpha_1}{1 + \tan \alpha_1 \tan \alpha_2} = \frac{m_2 - m_1}{1 + m_1 m_2}

Applying the absolute value to ensure an acute angle φ\varphi:

tan⁡φ=∣m2−m11+m1m2∣(1+m1m2≠0)\tan \varphi = \left| \frac{m_2 - m_1}{1 + m_1 m_2} \right| \quad (1 + m_1 m_2 \neq 0)

If 1+m1m2=01 + m_1 m_2 = 0, the lines are perpendicular (φ=90∘\varphi = 90^\circ).


Formula Box

Angle Between Two Lines

  1. Normal Vector Cosine Formula (Universal):
    cos⁡φ=∣A1A2+B1B2∣A12+B12A22+B22\cos \varphi = \frac{|A_1 A_2 + B_1 B_2|}{\sqrt{A_1^2 + B_1^2} \sqrt{A_2^2 + B_2^2}}
  2. Slope Tangent Formula (Non-vertical lines):
    tan⁡φ=∣m2−m11+m1m2∣(1+m1m2≠0)\tan \varphi = \left| \frac{m_2 - m_1}{1 + m_1 m_2} \right| \quad (1 + m_1 m_2 \neq 0)
  3. Standard Benchmark Angles:
    • cos⁡φ=1  ⟹  φ=0∘\cos \varphi = 1 \implies \varphi = 0^\circ (Parallel / Coincident)
    • cos⁡φ=32  ⟹  φ=30∘\cos \varphi = \frac{\sqrt{3}}{2} \implies \varphi = 30^\circ
    • cos⁡φ=22  ⟹  φ=45∘\cos \varphi = \frac{\sqrt{2}}{2} \implies \varphi = 45^\circ
    • cos⁡φ=12  ⟹  φ=60∘\cos \varphi = \frac{1}{2} \implies \varphi = 60^\circ
    • cos⁡φ=0  ⟹  φ=90∘\cos \varphi = 0 \implies \varphi = 90^\circ (Perpendicular)

2. Step-by-Step Paper Notebook Method

Line d: Ax + By + C = 0 Normal n = (A, B) M0(x0, y0)

3. Worked Notebook Examples

Example 1: Finding an Exact Standard Angle (45∘45^\circ)

Problem: Calculate the acute angle φ\varphi between the lines:

d1:3x−y+4=0andd2:2x+y−5=0d_1: 3x - y + 4 = 0 \quad \text{and} \quad d_2: 2x + y - 5 = 0

Step 1: Extract normal vectors

  • For d1d_1: n⃗1=(3,−1)\vec{n}_1 = (3, -1)
  • For d2d_2: n⃗2=(2,1)\vec{n}_2 = (2, 1)

Step 2: Compute the dot product

n⃗1⋅n⃗2=(3)(2)+(−1)(1)=6−1=5\vec{n}_1 \cdot \vec{n}_2 = (3)(2) + (-1)(1) = 6 - 1 = 5

Numerator:

∣n⃗1⋅n⃗2∣=∣5∣=5|\vec{n}_1 \cdot \vec{n}_2| = |5| = 5

Step 3: Compute magnitudes

∥n⃗1∥=32+(−1)2=9+1=10∥n⃗2∥=22+12=4+1=5\begin{aligned} \|\vec{n}_1\| &= \sqrt{3^2 + (-1)^2} = \sqrt{9 + 1} = \sqrt{10} \\ \|\vec{n}_2\| &= \sqrt{2^2 + 1^2} = \sqrt{4 + 1} = \sqrt{5} \end{aligned}

Step 4: Calculate cos⁡φ\cos \varphi

cos⁡φ=510⋅5=550\cos \varphi = \frac{5}{\sqrt{10} \cdot \sqrt{5}} = \frac{5}{\sqrt{50}}

Simplify 50=25⋅2=52\sqrt{50} = \sqrt{25 \cdot 2} = 5\sqrt{2}:

cos⁡φ=552=12=22\cos \varphi = \frac{5}{5\sqrt{2}} = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2}

Step 5: Identify the angle Since cos⁡45∘=22\cos 45^\circ = \frac{\sqrt{2}}{2}:

φ=45∘(or π4 radians)\varphi = 45^\circ \quad \left(\text{or } \frac{\pi}{4} \text{ radians}\right)

Final Answer:

φ=45∘\varphi = 45^\circ

Example 2: Involving Radical Coefficients (30∘30^\circ)

Problem: Determine the exact measure of the acute angle between:

d1:x−3y+1=0andd2:3x−y−7=0d_1: x - \sqrt{3}y + 1 = 0 \quad \text{and} \quad d_2: \sqrt{3}x - y - 7 = 0

Step 1: Identify normal vectors

  • n⃗1=(1,−3)\vec{n}_1 = (1, -\sqrt{3})
  • n⃗2=(3,−1)\vec{n}_2 = (\sqrt{3}, -1)

Step 2: Compute numerator

n⃗1⋅n⃗2=(1)(3)+(−3)(−1)=3+3=23∣n⃗1⋅n⃗2∣=23\begin{aligned} \vec{n}_1 \cdot \vec{n}_2 &= (1)(\sqrt{3}) + (-\sqrt{3})(-1) = \sqrt{3} + \sqrt{3} = 2\sqrt{3} \\ |\vec{n}_1 \cdot \vec{n}_2| &= 2\sqrt{3} \end{aligned}

Step 3: Compute magnitudes

∥n⃗1∥=12+(−3)2=1+3=4=2∥n⃗2∥=(3)2+(−1)2=3+1=4=2\begin{aligned} \|\vec{n}_1\| &= \sqrt{1^2 + (-\sqrt{3})^2} = \sqrt{1 + 3} = \sqrt{4} = 2 \\ \|\vec{n}_2\| &= \sqrt{(\sqrt{3})^2 + (-1)^2} = \sqrt{3 + 1} = \sqrt{4} = 2 \end{aligned}

Step 4: Compute cos⁡φ\cos \varphi

cos⁡φ=232⋅2=234=32\cos \varphi = \frac{2\sqrt{3}}{2 \cdot 2} = \frac{2\sqrt{3}}{4} = \frac{\sqrt{3}}{2}

Step 5: Identify the angle Since cos⁡30∘=32\cos 30^\circ = \frac{\sqrt{3}}{2}:

φ=30∘(or π6 radians)\varphi = 30^\circ \quad \left(\text{or } \frac{\pi}{6} \text{ radians}\right)

Final Answer:

φ=30∘\varphi = 30^\circ

Example 3: Comparison Using the Slope Method

Problem: Find the acute angle between lines l1:y=2x−3l_1: y = 2x - 3 and l2:y=−13x+1l_2: y = -\frac{1}{3}x + 1 using the tangent slope formula.

Step 1: Identify slopes

  • m1=2m_1 = 2
  • m2=−13m_2 = -\frac{1}{3}

Step 2: Apply the slope tangent formula

tan⁡φ=∣m2−m11+m1m2∣=∣−13−21+(2)(−13)∣=∣−731−23∣=∣−7313∣=∣−7∣=7\begin{aligned} \tan \varphi &= \left| \frac{m_2 - m_1}{1 + m_1 m_2} \right| \\ &= \left| \frac{-\frac{1}{3} - 2}{1 + (2)\left(-\frac{1}{3}\right)} \right| \\ &= \left| \frac{-\frac{7}{3}}{1 - \frac{2}{3}} \right| \\ &= \left| \frac{-\frac{7}{3}}{\frac{1}{3}} \right| = |-7| = 7 \end{aligned}

Step 3: State the angle Since 77 is not a standard special trigonometric value:

φ=arctan⁡(7)≈81.87∘\varphi = \arctan(7) \approx 81.87^\circ

Final Answer:

φ=arctan⁡(7)\varphi = \arctan(7)

4. Common Mistakes & Paper Traps

[!WARNING]

  1. Omitting the Absolute Value Bars: Calculating n⃗1⋅n⃗2∥n⃗1∥∥n⃗2∥=−12\frac{\vec{n}_1 \cdot \vec{n}_2}{\|\vec{n}_1\| \|\vec{n}_2\|} = -\frac{1}{2} and concluding that φ=120∘\varphi = 120^\circ. The angle between two lines is defined to be acute or right (φ≤90∘\varphi \le 90^\circ). The correct answer is 180∘−120∘=60∘180^\circ - 120^\circ = 60^\circ.
  2. Merging the Denominators Under One Sum: Writing A12+B12+A22+B22\sqrt{A_1^2 + B_1^2 + A_2^2 + B_2^2} instead of the product A12+B12⋅A22+B22\sqrt{A_1^2 + B_1^2} \cdot \sqrt{A_2^2 + B_2^2}. The product of norms is essential.
  3. Perpendicular Line Division by Zero: In the tangent formula tan⁡φ=∣m2−m11+m1m2∣\tan \varphi = \left|\frac{m_2 - m_1}{1 + m_1 m_2}\right|, if m1m2=−1m_1 m_2 = -1, the denominator is zero. This does NOT mean no solution; it means tan⁡φ\tan \varphi is undefined because φ=90∘\varphi = 90^\circ!

5. Pencil & Paper Practice

Try these exercises on paper:

Practice 1

Find the acute angle between d1:x+2y−6=0d_1: x + 2y - 6 = 0 and d2:2x−y+1=0d_2: 2x - y + 1 = 0.

Practice 2

Find the acute angle between d1:x−y+5=0d_1: x - y + 5 = 0 and d2:x=3d_2: x = 3.

Practice 3

Calculate cos⁡φ\cos \varphi between the lines 4x−3y+2=04x - 3y + 2 = 0 and 12x+5y−7=012x + 5y - 7 = 0.


Worked Solutions

Solution to Practice 1:

  • n⃗1=(1,2)\vec{n}_1 = (1, 2) and n⃗2=(2,−1)\vec{n}_2 = (2, -1).
  • Compute the dot product:
n⃗1⋅n⃗2=1(2)+2(−1)=2−2=0\vec{n}_1 \cdot \vec{n}_2 = 1(2) + 2(-1) = 2 - 2 = 0

Since the dot product is 00, the normal vectors are orthogonal, which means the lines are perpendicular:

φ=90∘\varphi = 90^\circ

Answer: φ=90∘\varphi = 90^\circ.


Solution to Practice 2:

  • For d1:x−y+5=0  ⟹  n⃗1=(1,−1)d_1: x - y + 5 = 0 \implies \vec{n}_1 = (1, -1).
  • For d2:x=3  ⟹  1x+0y−3=0  ⟹  n⃗2=(1,0)d_2: x = 3 \implies 1x + 0y - 3 = 0 \implies \vec{n}_2 = (1, 0).
  • Dot product: ∣n⃗1⋅n⃗2∣=∣1(1)+(−1)(0)∣=∣1∣=1|\vec{n}_1 \cdot \vec{n}_2| = |1(1) + (-1)(0)| = |1| = 1.
  • Magnitudes:
    • ∥n⃗1∥=12+(−1)2=2\|\vec{n}_1\| = \sqrt{1^2 + (-1)^2} = \sqrt{2}
    • ∥n⃗2∥=12+02=1\|\vec{n}_2\| = \sqrt{1^2 + 0^2} = 1
  • Cosine:
cos⁡φ=12⋅1=12=22  ⟹  φ=45∘\cos \varphi = \frac{1}{\sqrt{2} \cdot 1} = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \implies \varphi = 45^\circ

Answer: φ=45∘\varphi = 45^\circ.


Solution to Practice 3:

  • n⃗1=(4,−3)\vec{n}_1 = (4, -3), ∥n⃗1∥=42+(−3)2=16+9=25=5\|\vec{n}_1\| = \sqrt{4^2 + (-3)^2} = \sqrt{16 + 9} = \sqrt{25} = 5.
  • n⃗2=(12,5)\vec{n}_2 = (12, 5), ∥n⃗2∥=122+52=144+25=169=13\|\vec{n}_2\| = \sqrt{12^2 + 5^2} = \sqrt{144 + 25} = \sqrt{169} = 13.
  • Numerator:
∣n⃗1⋅n⃗2∣=∣4(12)+(−3)(5)∣=∣48−15∣=∣33∣=33|\vec{n}_1 \cdot \vec{n}_2| = |4(12) + (-3)(5)| = |48 - 15| = |33| = 33
  • Cosine:
cos⁡φ=335⋅13=3365\cos \varphi = \frac{33}{5 \cdot 13} = \frac{33}{65}

Answer: cos⁡φ=3365\cos \varphi = \frac{33}{65}.


Test yourself

What is the cosine of the acute angle φ\varphi between the lines x+y=0x + y = 0 and x−y=0x - y = 0?

  1. cos⁡φ=0\cos\varphi = 0
  2. cos⁡φ=1\cos\varphi = 1
  3. cos⁡φ=22\cos\varphi = \frac{\sqrt{2}}{2}
  4. cos⁡φ=12\cos\varphi = \frac{1}{2}

Why is an absolute value used in the numerator of cos⁡φ=∣A1A2+B1B2∣A12+B12A22+B22\cos\varphi = \frac{|A_1A_2 + B_1B_2|}{\sqrt{A_1^2 + B_1^2}\sqrt{A_2^2 + B_2^2}}?

  1. Because vector magnitudes are always negative.
  2. To ensure that cos⁡φ≥0\cos\varphi \ge 0, which guarantees the angle φ\varphi is acute (0∘≤φ≤90∘0^\circ \le \varphi \le 90^\circ).
  3. Because lines cannot have negative slopes.
  4. To eliminate imaginary numbers in the radical.

What is the angle between the lines y=3x+2y = \sqrt{3}x + 2 and y=3x−5y = \sqrt{3}x - 5?

  1. 0∘0^\circ
  2. 30∘30^\circ
  3. 60∘60^\circ
  4. 90∘90^\circ