Skip to content
Gioi Toan
Start learning
Two vectors joined head to tail on a grid, and their sum

Notes on Lesson 4: Relative position and angle between two straight lines. Distance from a point to a straight line (Maths 10 Canh Dieu, Chapter VII)

Lesson summary

In the coordinate plane, let two straight lines Δ1\Delta_1 and Δ2\Delta_2 have direction vectors u1⃗\vec{u_1}, u2⃗\vec{u_2} respectively.

Given two straight lines Δ1:a1x+b1y+c1=0\Delta_1: a_1x + b_1y + c_1 = 0 and Δ2:a2x+b2y+c2=0\Delta_2: a_2x + b_2y + c_2 = 0.

A direction vector is like a compass pointing along the road.

This content is not yet available in English. It is shown below in the original Vietnamese.

  • Xác định vị trí tương đối, góc giữa hai đường thẳng
  • Tính khoảng cách từ một điểm đến một đường thẳng

On a map, some roads cross each other to form a junction, and some roads run parallel and never meet. How can you tell whether they intersect, are parallel, are coincident lines or are perpendicular when all you have is their equations? And if you want to measure the shortest distance from your home to the main road, how do you work it out? This lesson will help you answer those questions with coordinates, so that you can work out the relative position, the angle between two straight lines and the distance from a point to a straight line without needing an accurate drawing.

Practise similar problems

Key ideas: what do you need to know?

Relative position of two straight lines using direction vectors

In the coordinate plane, let two straight lines Δ1\Delta_1 and Δ2\Delta_2 have direction vectors u1⃗\vec{u_1}, u2⃗\vec{u_2} respectively. Then:

  • Δ1\Delta_1 intersect Δ2\Delta_2 if and only if u1⃗\vec{u_1}, u2⃗\vec{u_2} are not parallel.
  • Δ1\Delta_1 is parallel to Δ2\Delta_2 if and only if u1⃗\vec{u_1}, u2⃗\vec{u_2} are parallel and there is a point that belongs to one line but does not belong to the other.
  • Δ1\Delta_1 are coincident lines with Δ2\Delta_2 if and only if u1⃗\vec{u_1}, u2⃗\vec{u_2} are parallel and there is a point that belongs to both lines.

Example: Δ1:x−2y+1=0\Delta_1: x - 2y + 1 = 0 has direction vector u1⃗=(2;1)\vec{u_1} = (2; 1), Δ2:2x−4y+5=0\Delta_2: 2x - 4y + 5 = 0 has direction vector u2⃗=(4;2)\vec{u_2} = (4; 2). Since u2⃗=2u1⃗\vec{u_2} = 2\vec{u_1}, the two lines are parallel or coincident lines. Take the point M(−1;0)M(-1; 0) on Δ1\Delta_1, substitute into Δ2\Delta_2 to get 2(−1)−4⋅0+5=3≠02(-1) - 4 \cdot 0 + 5 = 3 \ne 0, so MM does not belong to Δ2\Delta_2. Therefore Δ1\Delta_1 is parallel to Δ2\Delta_2.

In plain words: A direction vector is like a compass pointing along the road. If two lines intersect, the two compasses must point in different directions, meaning the two vectors are not parallel. If two lines are parallel or coincident lines, the two compasses point the same way, meaning the two vectors are parallel. Once they are parallel, to tell parallel from coincident lines you only need to test one point: if that point belongs to both lines, they are coincident lines; if it belongs to only one line, they are parallel. This is quick because you only look at the direction vectors, with no need to solve a system.

Phrase by phrase
direction vector
A nonzero vector 0⃗\vec{0} whose line of action is parallel to or lies on the straight line.Example: The straight line Δ:x−2y+1=0\Delta: x - 2y + 1 = 0 has direction vector u⃗=(2;1)\vec{u} = (2; 1).
not parallel
Two vectors whose lines of action are neither parallel nor coincident lines; there is no number kk for which one vector equals kk times the other.Example: (1;2)(1; 2) and (2;3)(2; 3) are not parallel.
parallel
Two vectors whose lines of action are parallel or coincident lines, that is, one vector is a multiple of the other.Example: (2;1)(2; 1) and (4;2)(4; 2) are parallel because (4;2)=2(2;1)(4; 2) = 2(2; 1).

Finding the relative position using a system of equations

Given two straight lines Δ1:a1x+b1y+c1=0\Delta_1: a_1x + b_1y + c_1 = 0 and Δ2:a2x+b2y+c2=0\Delta_2: a_2x + b_2y + c_2 = 0. Consider the system of equations
{a1x+b1y+c1=0a2x+b2y+c2=0(I)\begin{cases} a_1x + b_1y + c_1 = 0 \\ a_2x + b_2y + c_2 = 0 \end{cases} \quad (I)
Then:

  • Δ1\Delta_1 intersect Δ2\Delta_2 if and only if system (I) has a unique solution.
  • Δ1\Delta_1 is parallel to Δ2\Delta_2 if and only if system (I) has no solution.
  • Δ1\Delta_1 are coincident lines with Δ2\Delta_2 if and only if system (I) has infinitely many solutions.

Example: Δ1:x+y−3=0\Delta_1: x + y - 3 = 0 and Δ2:x−y−1=0\Delta_2: x - y - 1 = 0. Solving the system {x+y=3x−y=1\begin{cases} x + y = 3 \\ x - y = 1 \end{cases} gives x=2x = 2, y=1y = 1. The system has a unique solution, so the two lines intersect at M(2;1)M(2; 1).

In plain words: Each straight line is an equation, and the point of intersection is the point that satisfies both, so you have to solve the system. The three possibilities of the system are exactly the three relative positions: one solution is one point of intersection (intersect), no solution is no point of intersection (parallel), infinitely many solutions is sharing the whole line (coincident lines). This way is certain but you have to solve the system, while checking the direction vector is faster when you only need to know the relative position. Once you know they intersect, solve the system to find the coordinates of the point of intersection.

Phrase by phrase
system of equations
Two linear equations in two variables written together, their common solution is the point of intersection.Example: {x+y=3x−y=1\begin{cases} x + y = 3 \\ x - y = 1 \end{cases} gives the solution (2;1)(2; 1).
unique solution
The system has exactly one pair (x;y)(x; y), corresponding to one point of intersection.Example: The two lines intersect at M(2;1)M(2; 1).
no solution
No pair (x;y)(x; y) satisfies both, the two lines do not meet.Example: {x+y=1x+y=2\begin{cases} x + y = 1 \\ x + y = 2 \end{cases} has no solution.
infinitely many solutions
Every point of this line belongs to the other line, the two equations are equivalent.Example: x+y=1x + y = 1 and 2x+2y=22x + 2y = 2 are one line.

Angle between two straight lines

Two intersecting straight lines form four angles. If the two lines are not perpendicular to each other, the acute angle among those four is called the angle between two straight lines. If the two lines are perpendicular to each other, we say the angle between them equals 90∘90^\circ. When two lines are parallel or coincident, we agree that the angle between them equals 0∘0^\circ. Thus, the angle φ\varphi between two straight lines always satisfies 0∘≤φ≤90∘0^\circ \le \varphi \le 90^\circ.

In the coordinate plane, given two straight lines Δ1\Delta_1 and Δ2\Delta_2 with direction vectors u1⃗=(a1;b1)\vec{u_1} = (a_1; b_1), u2⃗=(a2;b2)\vec{u_2} = (a_2; b_2) respectively. Then:
cos⁡(Δ1,Δ2)=∣a1a2+b1b2∣a12+b12⋅a22+b22.\cos(\Delta_1, \Delta_2) = \frac{|a_1a_2 + b_1b_2|}{\sqrt{a_1^2 + b_1^2} \cdot \sqrt{a_2^2 + b_2^2}}.
If Δ1\Delta_1, Δ2\Delta_2 have normal vectors n1⃗\vec{n_1}, n2⃗\vec{n_2} respectively, then
cos⁡(Δ1,Δ2)=∣cos⁡(n1⃗,n2⃗)∣=∣n1⃗⋅n2⃗∣∣n1⃗∣⋅∣n2⃗∣.\cos(\Delta_1, \Delta_2) = \left|\cos(\vec{n_1}, \vec{n_2})\right| = \frac{|\vec{n_1} \cdot \vec{n_2}|}{|\vec{n_1}| \cdot |\vec{n_2}|}.
In particular, Δ1⊥Δ2⇔n1⃗⋅n2⃗=0\Delta_1 \perp \Delta_2 \Leftrightarrow \vec{n_1} \cdot \vec{n_2} = 0, that is a1a2+b1b2=0a_1a_2 + b_1b_2 = 0.

Example: Δ1:x+y=0\Delta_1: x + y = 0 has n1⃗=(1;1)\vec{n_1} = (1; 1), Δ2:x−y=0\Delta_2: x - y = 0 has n2⃗=(1;−1)\vec{n_2} = (1; -1). We have cos⁡φ=∣1⋅1+1⋅(−1)∣2⋅2=0\cos\varphi = \frac{|1 \cdot 1 + 1 \cdot (-1)|}{\sqrt{2} \cdot \sqrt{2}} = 0, so φ=90∘\varphi = 90^\circ.

In plain words: The angle between two straight lines is the non-obtuse angle formed by them, so it always goes from 0∘0^\circ to 90∘90^\circ. Why is there an absolute value in the numerator? Because the angle between two direction vectors can be an obtuse angle, but the angle between two straight lines takes the acute angle, so the sign must be dropped. This formula is like the formula for the angle between two vectors you have learned, just with an absolute value added. To check perpendicularity you do not need to compute the angle, just see whether a1a2+b1b2a_1a_2 + b_1b_2 equals 0.

Phrase by phrase
angle between two straight lines
The angle measure of the non-obtuse angle among the four angles formed by two intersecting straight lines; agreed to equal 0∘0^\circ if the two lines are parallel or coincident.Example: Two perpendicular lines have an angle of 90∘90^\circ.
normal vector
A vector other than 0⃗\vec{0} whose line of action is perpendicular to the straight line.Example: The straight line Δ:x−2y+1=0\Delta: x - 2y + 1 = 0 has normal vector n⃗=(1;−2)\vec{n} = (1; -2).
a1a2+b1b2=0a_1a_2 + b_1b_2 = 0
The perpendicularity condition of two straight lines when their normal vectors (a1;b1)(a_1; b_1) and (a2;b2)(a_2; b_2) are known.Example: x+2y=0x + 2y = 0 and 2x−y=02x - y = 0 are perpendicular because 1⋅2+2⋅(−1)=01 \cdot 2 + 2 \cdot (-1) = 0.

Common mistakesForgetting the absolute value sign in the numerator of the cosine formula, getting a negative cosine and then concluding an obtuse angle, while the angle between two straight lines is always from 0∘0^\circ to 90∘90^\circ.

TipChecking perpendicular with the product a1a2+b1b2a_1a_2 + b_1b_2 is faster than calculating the angle, because you only need to see whether it equals 0.

Distance from a point to a straight line

In the coordinate plane OxyOxy, given the straight line Δ\Delta with equation ax+by+c=0ax + by + c = 0 where a2+b2>0a^2 + b^2 > 0, and the point M0(x0;y0)M_0(x_0; y_0). The distance from the point M0M_0 to the straight line Δ\Delta, denoted d(M0,Δ)d(M_0, \Delta), is given by the formula:
d(M0,Δ)=∣ax0+by0+c∣a2+b2.d(M_0, \Delta) = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}.
Note: If M0∈ΔM_0 \in \Delta then d(M0,Δ)=0d(M_0, \Delta) = 0.

Example: The distance from M(1;2)M(1; 2) to Δ:3x−4y+5=0\Delta: 3x - 4y + 5 = 0 is d=∣3⋅1−4⋅2+5∣9+16=05=0d = \frac{|3 \cdot 1 - 4 \cdot 2 + 5|}{\sqrt{9 + 16}} = \frac{0}{5} = 0, so MM belongs to Δ\Delta.

In plain words: This formula is like substituting the coordinates of the point into the left-hand side of the equation of the line, taking the absolute value and then dividing by the length of the normal vector. Why divide by a2+b2\sqrt{a^2 + b^2}? Because if you multiply the whole equation by a number, the line does not change but the left-hand side grows, so you must divide to make the distance independent of how it is written. A numerator of 0 means the point lies right on the line. Distance is never negative, so do not forget the absolute value.

Phrase by phrase
d(M0,Δ)d(M_0, \Delta)
The distance from the point M0M_0 to the straight line Δ\Delta, which is the length of the perpendicular segment dropped from M0M_0 to Δ\Delta.Example: d(M0,Δ)=2d(M_0, \Delta) = 2 means M0M_0 is a distance of 2 from Δ\Delta.
ax0+by0+c=0ax_0 + by_0 + c = 0
The coordinates of M0M_0 satisfy the equation of Δ\Delta, that is the numerator equals 0, so M0M_0 lies on Δ\Delta.Example: With M(1;2)M(1; 2), Δ:3x−4y+5=0\Delta: 3x - 4y + 5 = 0: 3⋅1−4⋅2+5=03 \cdot 1 - 4 \cdot 2 + 5 = 0.
a2+b2\sqrt{a^2 + b^2}
The length of the normal vector (a;b)(a; b), used for normalizing.Example: Δ:3x−4y+5=0\Delta: 3x - 4y + 5 = 0 has 9+16=5\sqrt{9 + 16} = 5.

Common mistakesWhen the straight line is given in parametric form, forgetting to change it to the general equation and substituting straight into the distance formula, which leads to using the wrong coefficients aa, bb, cc.

Worked examples

Example 1

Determine the relative position of the two straight lines Δ1:2x−y+1=0\Delta_1: 2x - y + 1 = 0 and Δ2:−x+2y+2=0\Delta_2: -x + 2y + 2 = 0.

Show the solution to example 1

Step 1: Read the direction vector of each line. Δ1\Delta_1 has normal vector (2;−1)(2; -1), so its direction vector is u1⃗=(1;2)\vec{u_1} = (1; 2). Δ2\Delta_2 has normal vector (−1;2)(-1; 2), so its direction vector is u2⃗=(2;1)\vec{u_2} = (2; 1).
Step 2: Compare the two direction vectors: 12≠21\frac{1}{2} \ne \frac{2}{1}, so u1⃗\vec{u_1} and u2⃗\vec{u_2} are not parallel.
Why: Not being parallel means the two lines cannot be parallel or coincident lines, so they must intersect.
Step 3: Find the point of intersection by solving the system {2x−y+1=0−x+2y+2=0\begin{cases} 2x - y + 1 = 0 \\ -x + 2y + 2 = 0 \end{cases}. From the first equation y=2x+1y = 2x + 1, substitute into the second equation: −x+2(2x+1)+2=0-x + 2(2x + 1) + 2 = 0, that is 3x+4=03x + 4 = 0, x=−43x = -\frac{4}{3}. Then y=2⋅(−43)+1=−53y = 2 \cdot \left(-\frac{4}{3}\right) + 1 = -\frac{5}{3}.
Result: Δ1\Delta_1 intersects Δ2\Delta_2 at the point M(−43;−53)M\left(-\frac{4}{3}; -\frac{5}{3}\right).

Example 2

Determine the relative position of Δ3:x−y−1=0\Delta_3: x - y - 1 = 0 and Δ4:{x=1+2ty=3+2t\Delta_4: \begin{cases} x = 1 + 2t \\ y = 3 + 2t \end{cases}.

Show the solution to example 2

Step 1: Δ3\Delta_3 has normal vector (1;−1)(1; -1), so its direction vector is u3⃗=(1;1)\vec{u_3} = (1; 1). Δ4\Delta_4 has direction vector u4⃗=(2;2)\vec{u_4} = (2; 2).
Step 2: Notice that u4⃗=2u3⃗\vec{u_4} = 2\vec{u_3}, so the two direction vectors are parallel, therefore Δ3\Delta_3 is parallel or coincident with Δ4\Delta_4.
Step 3: Tell them apart by testing a point. Choose t=0t = 0 in the equation of Δ4\Delta_4 to get the point M(1;3)M(1; 3) that belongs to Δ4\Delta_4. Substitute into Δ3\Delta_3: 1−3−1=−3≠01 - 3 - 1 = -3 \ne 0, so MM does not belong to Δ3\Delta_3.
Why: If they are parallel and one point belongs to one line but not to the other, the two lines cannot be coincident lines, they are parallel.
Result: Δ3\Delta_3 is parallel to Δ4\Delta_4.

Common mistakesSeeing that two direction vectors (or normal vectors) are parallel and immediately concluding that the two lines are coincident lines, while they may be parallel. You must test a point to tell them apart: a point that belongs to both lines means coincident lines, a point that belongs to only one line means parallel.

TipLook at the pair of coefficients (a;b)(a; b) of the two lines: if they are proportional the lines are parallel or coincident lines, if not they intersect; to know whether they are coincident lines or parallel, substitute one point.

Example 3

Calculate the angle measure between the two straight lines Δ1:3x+y−10=0\Delta_1: 3x + y - 10 = 0 and Δ2:−2x+y−7=0\Delta_2: -2x + y - 7 = 0.

Show the solution to example 3

Step 1: Read the normal vectors: n1⃗=(3;1)\vec{n_1} = (3; 1), n2⃗=(−2;1)\vec{n_2} = (-2; 1).
Step 2: Calculate the dot product n1⃗⋅n2⃗=3⋅(−2)+1⋅1=−5\vec{n_1} \cdot \vec{n_2} = 3 \cdot (-2) + 1 \cdot 1 = -5. Lengths ∣n1⃗∣=9+1=10|\vec{n_1}| = \sqrt{9 + 1} = \sqrt{10}, ∣n2⃗∣=4+1=5|\vec{n_2}| = \sqrt{4 + 1} = \sqrt{5}.
Step 3: cos⁡(Δ1,Δ2)=∣−5∣10⋅5=550=552=12\cos(\Delta_1, \Delta_2) = \frac{|-5|}{\sqrt{10} \cdot \sqrt{5}} = \frac{5}{\sqrt{50}} = \frac{5}{5\sqrt{2}} = \frac{1}{\sqrt{2}}.
Why: A negative dot product shows that the two normal vectors form an obtuse angle, but the angle between two straight lines is taken as the non-obtuse angle, so you must take the absolute value.
Step 4: cos⁡(Δ1,Δ2)=12\cos(\Delta_1, \Delta_2) = \frac{1}{\sqrt{2}}, so the angle you need is 45∘45^\circ.
Result: (Δ1,Δ2)=45∘(\Delta_1, \Delta_2) = 45^\circ.

Example 4

Calculate the distance from point M(−2;1)M(-2; 1) to the straight line Δ:2x−3y+5=0\Delta: 2x - 3y + 5 = 0.

Show the solution to example 4

Step 1: Substitute the coordinates of MM into the left-hand side: 2⋅(−2)−3⋅1+5=−4−3+5=−22 \cdot (-2) - 3 \cdot 1 + 5 = -4 - 3 + 5 = -2.
Step 2: Calculate the length of the normal vector: 22+(−3)2=4+9=13\sqrt{2^2 + (-3)^2} = \sqrt{4 + 9} = \sqrt{13}.
Step 3: d(M,Δ)=∣−2∣13=213=21313d(M, \Delta) = \frac{|-2|}{\sqrt{13}} = \frac{2}{\sqrt{13}} = \frac{2\sqrt{13}}{13}.
Why: The numerator is negative but a distance is never negative, so you must take the absolute value; divide by 13\sqrt{13} so the result does not depend on how the equation is written.
Result: d(M,Δ)=21313d(M, \Delta) = \frac{2\sqrt{13}}{13}.

Common mistakesWhen calculating the distance you forgot to divide by a2+b2\sqrt{a^2 + b^2}, you only took ∣ax0+by0+c∣|ax_0 + by_0 + c|, so the result depends on how the equation is written and the units are wrong.

TipRemember the distance by rhythm: substitute the coordinates, take the absolute value, divide by the length of the normal vector, that is ∣ax0+by0+c∣a2+b2\frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}.

Example 5

Calculate the distance from point M(1;−3)M(1; -3) to the straight line Δ:{x=−2+3ty=2−4t\Delta: \begin{cases} x = -2 + 3t \\ y = 2 - 4t \end{cases}.

Show the solution to example 5

Step 1: Δ\Delta passes through the point N(−2;2)N(-2; 2) and has direction vector (3;−4)(3; -4), so its normal vector is n⃗=(4;3)\vec{n} = (4; 3).
Step 2: Write the general equation: 4(x+2)+3(y−2)=04(x + 2) + 3(y - 2) = 0, that is 4x+3y+2=04x + 3y + 2 = 0.
Step 3: Substitute M(1;−3)M(1; -3): 4⋅1+3⋅(−3)+2=4−9+2=−34 \cdot 1 + 3 \cdot (-3) + 2 = 4 - 9 + 2 = -3. The length of the normal vector is 16+9=5\sqrt{16 + 9} = 5.
Step 4: d(M,Δ)=∣−3∣5=35d(M, \Delta) = \frac{|-3|}{5} = \frac{3}{5}.
Why: The distance formula can only be used with the general equation, so you must convert from the parameter form to the general form first.
Result: d(M,Δ)=35d(M, \Delta) = \frac{3}{5}.

Common mistakesTaking the wrong normal vector: with Δ:2x−3y+1=0\Delta: 2x - 3y + 1 = 0 you wrote n⃗=(2;3)\vec{n} = (2; 3) instead of (2;−3)(2; -3), which makes both the angle and the perpendicular condition wrong.

Example 6

On a coordinate map with kilometres as the unit on the axes, a straight road has the equation 4x+3y−12=04x + 3y - 12 = 0. An's house is at the point A(1;1)A(1; 1). Calculate the shortest distance from An's house to the road. If An walks straight out perpendicular to the road, how many kilometres does An walk?

Show the solution to example 6

Step 1: The shortest distance from a point to a straight line is exactly d(A,Δ)d(A, \Delta) with Δ:4x+3y−12=0\Delta: 4x + 3y - 12 = 0.
Step 2: Substitute A(1;1)A(1; 1): 4⋅1+3⋅1−12=−54 \cdot 1 + 3 \cdot 1 - 12 = -5, take the absolute value to get 5.
Step 3: The length of the normal vector is 42+32=5\sqrt{4^2 + 3^2} = 5, so d(A,Δ)=55=1d(A, \Delta) = \frac{5}{5} = 1.
Why: The shortest path from a point to a straight line is the perpendicular, exactly equal to the distance in the formula, so walking straight out perpendicular to the road is the shortest distance.
Result: The shortest distance is 1 km, which is also the distance if An walks perpendicular to the road.

Terms

Direction vector
A nonzero vector 0⃗\vec{0} whose line of action is parallel to or lies on the straight line.Example: The straight line Δ:x−2y+1=0\Delta: x - 2y + 1 = 0 has direction vector u⃗=(2;1)\vec{u} = (2; 1).
Normal vector
A vector other than 0⃗\vec{0} whose line of action is perpendicular to the straight line.Example: The straight line Δ:x−2y+1=0\Delta: x - 2y + 1 = 0 has normal vector n⃗=(1;−2)\vec{n} = (1; -2).
Same direction
Two vectors whose lines are parallel or coincident lines, one vector is a multiple of the other.Example: (1;−2)(1; -2) and (2;−4)(2; -4) have the same direction.
Relative position
The relations intersect, parallel, coincident lines between two straight lines (perpendicular is a special case of intersect).Example: The two lines x+y=1x + y = 1 and x+y=2x + y = 2 are parallel.
Point of intersection
The common point of two intersecting straight lines, whose coordinates are the solution of a system.Example: x+y=3x + y = 3, x−y=1x - y = 1 intersect at (2;1)(2; 1).
Angle between two straight lines
The angle measure, not obtuse, formed by two intersecting straight lines, taken by convention as 0∘0^\circ when they are parallel or coincident lines; always from 0∘0^\circ to 90∘90^\circ.Example: Two perpendicular lines have an angle of 90∘90^\circ.
Distance from a point to a line
The length of the perpendicular dropped from the point to the straight line.Example: d(M,Δ)=∣ax0+by0+c∣a2+b2d(M, \Delta) = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}.
Dot product
With u⃗=(x1;y1)\vec{u} = (x_1; y_1), v⃗=(x2;y2)\vec{v} = (x_2; y_2) then u⃗⋅v⃗=x1x2+y1y2\vec{u} \cdot \vec{v} = x_1x_2 + y_1y_2.Example: (1;2)⋅(3;−1)=3−2=1(1; 2) \cdot (3; -1) = 3 - 2 = 1.