I have two lines defined by a point and a vector:
- $Q(s) = A + s\vec{v}$
- $P(t) = B + t\vec{u}$
Suppose distance d is given
I want to know $s$ and $t$ for points $P$ and $Q$ in terms of $d$. $d$ is perpendicular to $line(B, \vec{u})$
so I found out (wikipedia):
$ \begin{aligned} d & = ||(B - Q) - ((B - Q).\vec{u})\vec{u}|| \\ & = ||(B - A - s\vec{v}) - ((B - A - s\vec{v})\cdot\vec{u})\vec{u}|| \\ & = ||(\vec{w} - s\vec{v}) - ((\vec{w} - s\vec{v})\cdot\vec{u})\vec{u} || \end{aligned} $
Can somebody explain the algebra to write $s$ in terms of $d$
$s = f(d) = \dots$