Equation of a Line

$P$, $Q$ and $R$ have coordinates $\left(-2,1\right)$, $\left(2,2\right)$ and $\left(6,-2\right)$ respectively. Find: the gradient of $QR$, equation of $QR$ and the equation of a line through $P$ perpendicular to $QR$.


Given: $P \left(x_1, y_1\right) = \left(-2, 1\right)$; $\;$ $Q \left(x_2, y_2\right) = \left(2,2\right)$; $\;$ $R \left(x_3, y_3\right) = \left(6, -2\right)$

Gradient of $QR = m_1 = \dfrac{y_3 - y_2}{x_3 - x_2} = \dfrac{-2 - 2}{6 -2} = \dfrac{-4}{4} = -1$

Equation of $QR$: $\;$ $y - y_2 = m_1 \left(x - x_2\right)$

i.e. $\;$ $y - 2 = -1 \left(x - 2\right)$

i.e. $\;$ $y - 2 = -x + 2$

i.e. $\;$ $x + y - 4 = 0$

Slope of line perpendicular to $QR = m_2 = - \dfrac{1}{m_1} = 1$

$\therefore \;$ Equation of line perpendicular to $QR$ and passing through $P$ is

$y - y_1 = m_2 \left(x - x_1\right)$

i.e. $\;$ $y - 1 = 1 \left(x + 2\right)$

i.e. $\;$ $x - y + 3 = 0$