Equation of a line passing through a point and perpendicular to another line

analytic geometrygeometryvectors

Find the equation of a line $n$ passing through point $T(2,3,1)$ which is also perpendicular to a line given by equation $$p:\frac{x+1}{2}=\frac{y}{-1}=\frac{z+2}{1}$$

I did this using two methods both giving me the same solution and both differing from the solution that's apparently correct, which is $$n:\frac{x-2}{-3}=\frac{y-3}{-3}=\frac{z-1}{1}$$

My solutions:
$1$. method
We can find orthogonal projection of a point $T$ on a line $p$ by finding a intersection point between some plane $\alpha$, such that it contains point $T$ and is perpendicular to line $p$, and line $p$. We know, from the fact that $p$ is perpendicular to $\alpha$, that
$\vec{n_\alpha}=(2,-1,1)$. After plugging in point $T$, we get:
$$\alpha: 2x-y+z-2=0$$
Writing line $p$ in its parametric form, there is:
$$x=2t-1$$
$$y=-t$$
$$z=t-2$$
where $t\in\mathbb{R}$. So we from the the system of equation of $\alpha$ and $p$ in the written form we can find that $t=1$. From whis follows point of intersection and also orthogonal projection $S(1,-1,-1)$
After putting the points $T$ and $S$ in the equation of line between two points, the result I got is:
$$n:\frac{x-1}{1}=\frac{y+1}{4}=\frac{z+1}{2}$$
And obviously the vector of direction of aforementioned solution is not colinear to the solution I got.

$2$. method
Let $$n:\frac{x-2}{a}=\frac{y-3}{b}=\frac{z-1}{c}$$
There need to be 2 condition satisfied. First that $\vec{n}\cdot\vec{p}=0$, where $\vec{n}$ and $\vec{p}$ are vector of directions of $n$ and $p$, respectively. And second that these two lines are perpendicular to each other.
From first condition we can find the equation $(a,b,c)\cdot(2,-1,1)=2a-b+c=0$.
For the second condition we can take the point $M(-1,0,-1)$ from the line $p$ and then we get the equation:
$$\begin{vmatrix}
-3 & -3 & -3\\
a & b & c\\
2 & -1 & 1
\end{vmatrix}=6a+3b-9c=0 $$

After solving this system of two equation we get $(a,4a,2a)$ from which we can set $\vec{n}=(1,4,2)$. This gives the solution:
$$n:\frac{x-2}{1}=\frac{y-3}{4}=\frac{z-1}{2}$$
Which is indeed the same as with $1$. method just at a different point.

If I'm not mistaken this method is fine, so is it possible that my solution is the right one, or did I make some mistake in the calcution?

Best Answer

The given line is

$ \dfrac{x+1}{2} = \dfrac{y}{-1} = \dfrac{z+2}{1} = t$

so the parametric equation of the given line is

$(x, y, z) = (-1, 0, -2) + t (2, -1, 1) $

The required line passes through $T = (2,3,1)$ and is perpendicular to the given line. Let the point of intersection between the two lines be

$ P = (-1, 0, -2) + t (2, -1, 1) $

Then we want $TP \perp (2, -1, 1) $ , i.e.

$( (-3, -3, -3) + t (2, -1, 1) ) \cdot (2, -1, 1) = 0 $

This gives us

$ -6 + t (6) = 0 $

so $ t= 1 $ and $P = (1,-1,-1) $

So now the required line is just the line $TP$, the direction vector of which is

$d = P - T = (-1, -4, -2) $

or $d = (1,4, 2) $

Therefore, the equation of the line is

$ \dfrac{ x - 2 }{1} = \dfrac{ y - 3}{4} = \dfrac{z - 1}{2} $