Finding the general equation of a perpendicular line to a given line that passes through a point. (using vector algebra)

60 Views Asked by At

How can I find the genral equation of a perpendicular line to a given line that passes through a point, using vector algebra?

For example:

given a line $\ell_1: \begin{bmatrix}a_1 \\ a_2 \end{bmatrix} + t \begin{bmatrix}b_1 - a_1 \\ b_2 - a_2\end{bmatrix}$

and a point $\mathbf{P} = \begin{pmatrix}0 \\ 0 \end{pmatrix}$

How can you fine the general equation (form: $\;\;a_1x + b_1y + c = 0 \;\;$) of the line $\ell_2$ that passes through $\mathbf{P}$ and perpendicular to $\ell_1$?

3

There are 3 best solutions below

0
On

Since the line $\ell_2$ must pass through the origin, it is of the form

$t\left[\begin{matrix}c_1\\ c_2 \end{matrix}\right]$,

for some $c_1,c_2\in\mathbb{R}$.

As $\ell_2 \perp\ell_1$, one ought to have that any vector parallel to second line is orthogonal to any parallel to the first one, that is

$\left[\begin{matrix}t c_1\\ tc_2 \end{matrix}\right]^T\left[\begin{matrix}s(b_1-a_1)\\ s(b_2-a_2) \end{matrix}\right]=0$

for all $s,t\in\mathbb{R}$. Now, you may take $s=1$ and you get your answer.

0
On

Let the equation of the given line be $\vec{r}= \vec{a} + \lambda \vec{b}$ and the given point be $P \equiv\vec{c}$. Let the perpendicular line meet the given line at $Q$ given as $\vec{a} + \lambda \vec{b}$. Then $\vec{PQ} = \vec{a} + \lambda \vec{b} - \vec{c} $. $\vec{PQ} \cdot \vec{b}=0$. Therefore, $\begin{equation*} \lambda = \frac{(\vec{c} - \vec{a}) \cdot \vec{b}}{|\vec{b}|^2} \end{equation*}$

We have the position vector of $Q$ and therefore direction vector of the line $P$, say $\vec{d}$. Then equation of $PQ$ is $\vec{c} + \lambda \vec{d}$

0
On

First, find the point C on the line which is closest to point P.

The line is defined by $L=A+t\,\left(B-A\right)$ where $t$ is an arbitrary scalar value.

The distance (squared) to the target point is $$ d^{2}=\left(P-L\right)\cdot\left(P-L\right)$$

Here $\cdot$ denotes the vector dot product $A\cdot B = A_x B_x + A_y B_y $

Now we find $t$ which sets $\tfrac{{\rm d}}{{\rm d}t}\left(d^{2}\right)=0$

$$\begin{aligned}d^{2} & =\left(\left(P-A\right)-t\,\left(B-A\right)\right)\cdot\left(\left(P-A\right)-t\,\left(B-A\right)\right)\\ \tfrac{{\rm d}}{{\rm d}t}\left(d^{2}\right) & =2\left(\left(P-A\right)-t\,\left(B-A\right)\right)\cdot\tfrac{{\rm d}}{{\rm d}t}\left(\left(P-A\right)-t\,\left(B-A\right)\right)\\ 0 & =-2\left(\left(P-A\right)-t\,\left(B-A\right)\right)\cdot\left(B-A\right)\\ 0 & =\left(P-A\right)\cdot\left(B-A\right)-t\,\left(B-A\right)\cdot\left(B-A\right)\\ t & =\frac{\left(P-A\right)\cdot\left(B-A\right)}{\left(B-A\right)\cdot\left(B-A\right)} \end{aligned}$$

And so point C is

$$ C=A+\frac{\left(P-A\right)\cdot\left(B-A\right)}{\left(B-A\right)\cdot\left(B-A\right)}\,\left(B-A\right) $$

You can now draw a perpendicular line between P and C

$$ M = P + u\, \left( C-P \right) $$ where $u$ is an arbitrary value.