Skip to main content

BASIC MATHEMATICS FOR NATURAL SCIENCES UNDERGRADUATE STUDENT TEXTBOOK

Section 4.1 Distance Formula and Equation of Lines

By the end of this section, you should

Subsection 4.1.1 Distance between two points and division of segments

If P and Q are two points on the coordinate plane, then PQ represents the line segment joining P and Q and d(P,Q) or |PQ| represents the distance between P and Q.
Recall that the distance between points a and b on a number line is |a -b| = |b βˆ’a|. Thus, the distance between two points P(\(x_1\text{,}\) \(y_1\)) and R(\(x_2\text{,}\) \(y_1\)) on a horizontal line must be |\(x_2\) \(x_1\)| and the distance between Q(\(x_2\text{,}\) \(y_2\)) and R(\(x_2\text{,}\) \(y_1\)) on a vertical line must be |\(y_2\) -\(y_1\)|.(See, FigureΒ 4.1.1) .
Figure 4.1.1.
To find distance \(|PQ|\) between any two points \(P(x_1, y_1)\) and \(Q(x_2, y_2)\text{,}\) we note that triangle PRQ in FigureΒ 4.1.1 is a right triangle, and so by Pythagorean Theorem we get:
\(|PQ|^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2 \iff |PQ| = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\)
Therefore, we have the following:
\(\textbf{Distance Formula:}\) The distance between the points P(\(x_1\text{,}\) \(y_1\)) and Q(\(x_2\text{,}\) \(y_2\)) is
\begin{equation*} \left | PQ\right | = \sqrt[]{(x^{2}-x^{1})^{2}+(y^{2}-y^{1})^{2}} \end{equation*}
Note that, from the distance formula, the distance between the origin O(0,0) and a point P(x, y) is
\begin{equation*} \left | QP\right | = \sqrt[]{x^{2}+y^{2}} \end{equation*}

Example 4.1.2.

  1. The distance between O(0,0) and P(3,4) is
    \begin{equation*} \left | QP\right | = \sqrt[]{3^{2}+4^{2}} = 5 \end{equation*}
  2. The distance between P(1,2) and Q(3,6) is
    \begin{equation*} \left | PQ\right | = \sqrt{(3-1)^{2}+(6-2)^{2}} = \sqrt{20} \end{equation*}
  3. The distance between P(βˆ’1,2) and Q(5,βˆ’6) is
    \begin{equation*} \left | PQ\right | = \sqrt{(5+1)^{2}+(-6-2)^{2}} = \sqrt{10} \end{equation*}
Division point of a line segment: Given two distinct points P(\(x_1\text{,}\) \(y_1\)) and Q(\(x_2\text{,}\) \(y_2\)) in the coordinate plane, we want to find the coordinates (\(x_0\text{,}\) \(y_0\)) of the point R that lies on the segment PQ and divides the segment in the ratio \(r_1\) to \(r_2\) ; that is
\begin{equation*} \frac{\left |PR \right |}{\left | RQ\right |}=\frac{r_{1}}{r_{2}} , \end{equation*}
where \(r_1\) and \(r_2\) are given positive numbers. (FigureΒ 4.1.3)
Figure 4.1.3.
To determine (\(x_0\text{,}\) \(y_0\)), we construct two right triangles βˆ†PSR and βˆ†RTQ as shown. We then have |PS| = \(x\) βˆ’\(x\) , |SR| = \(y_0\)βˆ’\(y_1\) , |RT| = x_2 βˆ’x_0 , and |TQ| = y_2 βˆ’y_0 . Now since βˆ†PSR is similar to βˆ†RTQ, we have that
\begin{equation*} \frac{x_{0}- x_{1}}{x_{2}-x_{0}}=\frac{r_{1}}{r_{2}} and \frac{y_{0}- y_{1}}{y_{2}-y_{0}}=\frac{r_{1}}{r_{2}} \end{equation*}
or \(r_2\)(\(x_0\) βˆ’\(x_1\)) = \(r_1\) (\(x_2\) βˆ’\(x_0\)) and \(r_2\)(\(y\) βˆ’\(y\)) = \(r_1\) (\(y_2\) βˆ’\(y_0\)) .
Solving for \(x_0\) and \(y_0\) , we obtain
\begin{equation*} x_{0}= \frac{x_{1}r_{2}+x_{2}r_{1}}{r_{1}+r_{2}} \, \quad and \quad \, y_{0}= \frac{y_{1}r_{2}+y_{2}r_{1}}{r_{1}+r_{2}} \end{equation*}
Therefore, we have shown the following.

Example 4.1.5.

Given P(βˆ’3, 3) and Q(7,8 ),
  1. find the coordinates of the point R on the line segment PQ such that |PR| : |RQ| = 2 : 3.
  2. find the coordinates of the midpoint of PQ.
Solution.
  1. Obviously R(\(x_0\) ,\(y_0\)) is given by
    \begin{equation*} \left ( x_{0},y_{0} \right )=\left ( \frac{-3\times3+7\times2}{2+3},\frac{3\times3+8\times2}{2+3} \right ) = \left ( 1,5 \right ) \end{equation*}
  2. The coordinates of the midpoint is
    \begin{equation*} \left ( \frac{-3+7}{2},\frac{3+8}{2} \right ) = \left ( 2,\frac{11}{2} \right ) \end{equation*}

Exercises Exercises

2.
If the vertices of βˆ†ABC are A(1,1), B(4,5) and C(7, 1), find the perimeter of the triangle.
3.
Let P = (βˆ’3,0) and Q be a point on the positive y-axis. Find the coordinates of Q if |PQ| =5.
5.
Let M(βˆ’1,3) be the midpoint of a line segment PQ. If the coordinates of P is (βˆ’5, βˆ’7), then what is the coordinates of Q?
6.
Let A(a, 0), B(0,b) and O(0,0) be the vertices of a right triangle. Show that the midpoint of AB is equidistant from the vertices of the triangle

Checkpoint 4.1.6.

Add review
 1 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FDistance-between-two-points-and-division-of-segments%2FFinding-the-Distance-Between-Two-Points-in-R3.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-distance-between-two-points-and.ptx

Checkpoint 4.1.7.

Add review
 2 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FDistance-between-two-points-and-division-of-segments%2FCalculating-Distance-Between-Two-Coordinates.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-distance-between-two-points-and.ptx

Checkpoint 4.1.8.

Add review
 3 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FDistance-between-two-points-and-division-of-segments%2FFinding-Distance-between-Points-in-R4.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-distance-between-two-points-and.ptx

Checkpoint 4.1.9.

Add review
 4 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FDistance-between-two-points-and-division-of-segments%2FFinding-Possible-Values-of-a-Given-Distance-between-Points.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-distance-between-two-points-and.ptx

Subsection 4.1.2 Equations of lines

An equation of a line l is an equation which must be satisfied by the coordinates (x, y) of every point on the line. A line can be vertical, horizontal or oblique. The equation of a vertical line that intersects the x-axis at (a, 0) is x=a because the x-coordinate of every point on the line is a. Similarly, the equation of a horizontal line that intersects the y-axis at (0, b) is y=b because the y-coordinate of every point on the line is b.
An oblique line is a straight line which is neither vertical nor horizontal. To find equation of an oblique line we use its slope which is the measure of the steepness of the line. In particular, the slope of a line is defined as follows.

Definition 4.1.10.

The slope of a non-vertical line that passes through the points
\(P_1\)(\(x_1\text{,}\) \(y_1\)) and \(P_2\)(\(x_2\text{,}\) \(y_2\)) is
\begin{equation*} m=\frac{\Delta y}{\Delta x }=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} \end{equation*}
The slope of a vertical line is not defined. Note that the slope of horizontal line is 0.
Figure 4.1.11.
Thus the slope of a line l is the ratio of the change in y, βˆ†y, to the change in x, βˆ†x (See FigureΒ 4.1.11). Hence, slope is the rate of change of y with respect x. The slope depends also on the angle of inclination of the line. Note that the angle of inclination ΞΈ is the angle between x-axis and the line (measured counterclockwise from the direction of positive x-axis to the line). Observe that
\begin{equation*} \text{tan} \, \theta =\frac{\Delta y}{\Delta x} \end{equation*}
Therefore, if ΞΈ is the angle of inclination of a line, then its slope is m = tanΞΈ.
Now let us find an equation of the line that passes through a point \(P_1\)(\(x_1\text{,}\) \(y_1\)) and has slope m. A point P(x, y) with x≠\(x_1\) lies on this line if and only if the slope of the line though \(P_1\) and P is m; that is
\begin{equation*} \frac{y-y_{1}}{x-x_{1}} = m \end{equation*}
This leads to the following equation of the line:
\begin{equation*} y-y_{1}=m\left ( x-x_{1} \right ) \, \text{( called point-slope form of equation of a line).} \end{equation*}
In general, depending on the given information, you can show that the equations of oblique lines can be obtained using the following formulas.
\(\textbf{Given Information}\)
\(\textbf{X Formula for Equation of the Line}\)
Slope m and its y-intercept (0,b)
V Slope-Intercept-Form: y = mx + b
Slope \(m\) and a point (\(x_1\text{,}\) \(y_1\)) on l
Point-Slope-Form: \(y – y_1\)= \(m\)(\(x –x_1\))
Or y = m(\(x –x_1\)) \(+ y_1\)
Two points (\(x_1\text{,}\) \(y_1\)) and (\(x_2\text{,}\) \(y_2\)) on l
Two-Point Form: \(y-y_{1}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\left ( x-x_{1} \right )\)
x-intercept (a,0) and y-intercept (0,b)
Intercept Form: \(\frac{x}{a}+\frac{y}{b}=1\)

Example 4.1.12.

Find an equation of the line l if
  1. the line passes through (3, βˆ’2) and its angle of inclination is 135Β°.
  2. the line passes through the points (1, 2) and (4, βˆ’2)
Solution.
  1. The slope of l is m= tan(135Β°) = βˆ’1; and it passes through point (3, βˆ’2). Thus, using the point-slope form with \(x_1\)= 3 and \(y_1\)= βˆ’2, we obtain the equation of the line as
    y – (βˆ’2)= βˆ’1(x –3) which simplifies to y = βˆ’x + 1.
  2. Given the line passes through (1, 2) and (4, βˆ’2) , the slope of the line is
    \begin{equation*} m=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}=\frac{-2-2}{4-1}=\frac{-4}{3} \end{equation*}
    So, using the point-slope form with \(x_1\)= 1 and \(y_1\)= 2, we obtain the equation of the line as
    \(y-2=\frac{-4}{3}\left ( x-1 \right )\) which simplifies to 4x + 3y =10.
    (Note that it is possible to use the two-point form to find the equation of this line)
\(\textbf{General Form:}\) In general, the equation of a straight line can be written as
\begin{equation*} ax + by + c = 0, \end{equation*}
for constants a, b, c with a and b not both zero. Indeed, if a=0 the line is a horizontal line given by y = βˆ’c/b, if b=0 the line is a vertical line given by x = βˆ’c/a, and if both a, bβ‰  0 it is the oblique line given by \(y=-\left ( \frac{a}{b} \right )x-\frac{c}{b}\) with slope \(m=-\frac{a}{b}\) and y-intercept \(y=-\frac{c}{b}\) .
\(\textbf{Parallel and Perpendicular lines:}\) slopes can be used to check whether lines are parallel, perpendicular or not. In particular, let \(I_1\) and \(l_2\) be non-vertical lines with slope \(m_1\) and \(m_2\text{,}\) respectively. Then,
  1. \(l_1\) and \(l_2\) are parallel by \(l_1\) || \(l_2\) iff \(m_1\) = \(m_2\text{.}\)
  2. \(l_1\) and \(l_2\) are perpendicular, denoted by \(l_1\) | \(l_2\) iff \(m_1\)\(m_2\) (or \(m_{2}= -\frac{1}{m_{1}}\))
Moreover, if \(l_1\) and \(l_2\) are are both vertical lines then they are parallel. However, if one of them is horizontal and the other is vertical, then they are perpendicular.

Example 4.1.13.

Find an equation of the line through the point (3,2) that is parallel to the line
\(2x +3y +5 =0\)
Solution.
The given line can be written in the form \(y= \frac{-2}{3}x-\frac{5}{3}\) which is the slope-intercept form; that is, it has slope \(m= -\frac{2}{3}\) So, as parallel lines have the same slope, the required line has slope \(-\frac{2}{3}\) Therefore, its equation in point-slope form is \(y-2=\frac{-2}{3}\left ( x-3 \right )\) which can be simplified to \(2x+3y=12\)

Example 4.1.14.

Show that the lines \(2x + 3y + 5=0\) and \(3x-2y-4=0\) are perpendicular.
Solution.
The equations can be written as \(y=\frac{-2}{3}x-\frac{5}{3}\) and \(y=\frac{3}{2}x-2\) from which we can see that \(m_{1}=-\frac{2}{3}\) and \(m_{2}=\frac{3}{2}\text{.}\) Since \(m_1m_2=-1\text{,}\) the lines are perpendicular.

Exercises Exercises

1.
Find the slope and equation of the line determined by the following pair of points. Also find the y- and x- intercepts, if any, and draw each line.
  1. (0, 2) and (3, 2)
  2. (2, 0) and (2, 3)
  3. The origin and (1,0)
  4. The origin and (βˆ’1, 0)
  5. The origin and (1,2)
  6. The origin and (1,βˆ’3)
  7. (1,2) and (3, 4)
  8. (βˆ’2, βˆ’3), (2, 5)
  9. (βˆ’1, 3) and (1, 6 )
  10. (βˆ’3, βˆ’2) and (2, βˆ’2)
  11. (0, 3) and (3, 0)
  12. (βˆ’1, 0) and (0, 2)
2.
Find the slope and equation of the line whose angle of inclination is ΞΈ and passes through the point P, if
  1. \(\theta = \frac{1}{4}\pi \text{,}\) P = (1,1).
  2. \(\theta = \frac{1}{4}\pi \) ,P = (0,1).
  3. \(\theta = \frac{3}{4}\pi \text{,}\)P = (0,1).
  4. \(\theta = 0\text{,}\)P = (0, 1).
  5. \(\theta = \frac{1}{3}\pi \text{,}\) P = (1, 3).
  6. \(\theta = \frac{1}{3}\pi \text{,}\) P = (1,βˆ’3).
3.
Find the x-and y-intercepts and slope of the line given by \(\frac{x}{2}-\frac{y}{3}=1\) , and draw the line.
5.
Find the equation of the line that passes through (2, βˆ’1) and perpendicular to 3x + 4y = 6.
6.
Suppose \(l_1\) and \(l_2\) are perpendicular lines intersecting at (βˆ’1, 2). If the angle of inclination of \(l_1\) is 45Β°, then find an equation of \(l_2\) .
8.
Let \(L_1\) be the line passing through P(a, b) and Q(b, a) such that a≠b. Find an equation of the line \(L_2\) in terms of a and b if
  1. \(L_2\) passes through P and perpendicular to \(L_1\)
  2. \(L_2\) passes through (a,a) and parallel to \(L_1\)
9.
Let \(L_1\) and \(L_2\) be given by 2x + 3y βˆ’4= 0 and x +3y βˆ’5= 0, respectively. A third line \(L_3\) is perpendicular to \(L_1\text{.}\) Find an equation of \(L3\) if the three lines intersect at the same point.

Checkpoint 4.1.15.

Add review
 5 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FEquations-of-lines%2FDetermining-Collinearity-Using-Slope.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-equations-of-lines.ptx

Checkpoint 4.1.16.

Add review
 6 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FEquations-of-lines%2FEquations-of-Lines-Parallel-and-Perpendicular-to-a-Given-Line.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-equations-of-lines.ptx

Checkpoint 4.1.17.

Add review
 7 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FEquations-of-lines%2FFinding-Equation-of-a-Line-with-Given-Slope-and-Point.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-equations-of-lines.ptx

Checkpoint 4.1.18.

Add review
 8 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FEquations-of-lines%2FEquations-of-a-Line-Passing-Through-Two-Points.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-equations-of-lines.ptx

Subsection 4.1.3 Distance between a point and a line

Suppose a line \(l\) and a point P(x,y) not on the line are given. The distance from P to \(l\text{,}\) d(P, \(l\)), is defined as the perpendicular distance between P and l . That is,
d(P, \(l\)) = |PQ|, where Q is the point on \(l\) such that PQβŠ₯ \(l\text{.}\)(See FigureΒ 4.1.19)
Figure 4.1.19.
If P is on \(l\text{,}\) then d(P, \(l\)) = 0. Moreover, given a point P(h,k) observe that
  1. if the line \(l\) is a horizontal line y=b, then d(P, \(l\)) = |k – b|.
  2. if the line \(l\) is a vertical line x=a, then d(P, \(l\)) = |h – a|
In general, however, to find the distance between a point P(\(x_0\)\(, y_0\)) and an arbitrary line \(l\) given by ax + by +c = 0, we have to first get a point Q on \(l\) such that PQβŠ₯ \(l\) and then compute |PQ|. This yields the formula given in the following Theorem.
In particular, if we take (\(x_0\)\(,y_0\))=(0,0) in this formula, we obtain the distance between the origin O(0,0) and a line L : ax + by +c = 0 which is given by
\begin{equation*} d\left ( O,L \right )=\frac{\left | c\right |}{\sqrt{a^{2}+b^{2}}} \end{equation*}

Example 4.1.21.

Show that the origin and P(6,4) are equidistant from the line \(L:y=-\frac{3}{2}x+\frac{13}{2}\text{.}\)
Solution.
By equidistant we mean equal distance. So, we need to show d(O, L) = d(P, L).
To use the above formula, we first write the equation of the line L in the general form which is 3x + 2y –13 = 0. Thus, a =3, b =2 and c = –13.
\begin{equation*} d\left ( O,L \right )=\frac{\left | c\right |}{\sqrt{a^{2}+b^{2}}} = \frac{\left | -13\right |}{\sqrt{9+4}} = \frac{13}{\sqrt{13}} \end{equation*}
and
\begin{equation*} d\left ( P,L \right )=\frac{\left | 3\times6+\times4-13\right |}{\sqrt{3^{2}+2^{2}}} = \frac{13}{\sqrt{13}} \end{equation*}
Therefore, d(O, L) = d(P, L) = \(= \frac{13}{\sqrt{13}}\)
Thus, O(0,0) and P(6,4) are equidistant from the given line L.

Exercises Exercises

5.
The vertices of βˆ†ABC are given below. Find the length of the side BC, the height of the altitude from vertex A to BC, and the area of the triangle when its vertices are
  1. A(3, 4), B(2, 1), and C(6, 1)
  2. A(3, 4), B(1, 1), and C(5, 2)

Checkpoint 4.1.22.

Add review
 9 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FDistance-between-a-point-and-a-line%2FCalculating-the-Distance-from-the-Origin-to-a-Given-Line.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-distance-between-a-point-and.ptx

Checkpoint 4.1.23.

Add review
 10 
docs.google.com/forms/d/e/1FAIpQLSfSNI6CXkmgeSZJh6v0WKkeD9MJ9g4pEQ9r0JaowD4ovNxj5w/viewform?usp=pp_url&entry.699375810=questions%2Ftop%2FMathematics-for-NS-%26-SS-23-24-Question-Bank%2FAnalytic-Geometry-%28NS%29%2FDistance-between-a-point-and-a-line%2FFinding-Distance-between-a-Point-and-a-Line-in-Exact-Form.xml&entry.2077830997=source%2Fanalytic-geometry%2Fsections%2Fsubsections%2Fsec-distance-formula-and-equation-of%2Fsubsec-distance-between-a-point-and.ptx