I've some questions about the proof of $\displaystyle w = u + \{(p-u) \cdot T\}T = p - \{(p-u) \cdot N\}N$

As you can see there are two parts to the proof.

Let $\displaystyle L$ be a line and let $\displaystyle p$ be a point. There is a unique point $\displaystyle w$ on $\displaystyle L$ for which $\displaystyle (w - p)$ is orthogonal to $\displaystyle L$. Moreover, $\displaystyle w$ is given by

the following formulas:

$\displaystyle w = u + \{(p - u) \cdot T\}T = p - \{(p - u) \cdot N\}N ,$

where $\displaystyle u$ is any point on $\displaystyle L$, $\displaystyle T$ is a unit vector in the direction of $\displaystyle L$, and $\displaystyle N$ is a unit vector orthogonal to $\displaystyle T$.

Proof:

$\displaystyle L$ can be parameterized as $\displaystyle z(t) = u + tT$(Vector equation of line). We seek a point $\displaystyle z(t)$ for which $\displaystyle z(t) - p$ is orthogonal to the direction $\displaystyle T$ of the line, i.e. for which

$\displaystyle 0 = (p - z(t)) \cdot T = (p - u - tT) \cdot T$ This relation has a unique solution $\displaystyle t = (p - u) \cdot T$ Substituting for $\displaystyle t$ in $\displaystyle z(t)$ gives the first

formula(first proof) for $\displaystyle w$ in the statement of the result.

My question is:

How did the author find the solution $\displaystyle t = (p - u) \cdot T$ from the equation? What method he used for this?

How did he conclude that $\displaystyle w = u + \{(p-u) \cdot T\}T$?

And back to the proof.

Substituting $\displaystyle v = p - u$ into:

$\displaystyle v = (v \cdot T) T + (v \cdot N) N$

gives the second part of the proof.

How to prove $\displaystyle w = p - \{(p-u) \cdot N\}N$ by substituting $\displaystyle v = p - u$ into $\displaystyle v = (v \cdot T) T + (v \cdot N) N$?