Three-dimensional space position vector problem

55 Views Asked by At

In a three-dimensional space there exists a point $A$ and it's position vector $a$ is expressed as

$$a=\overrightarrow{OA}=\begin{bmatrix} a_{1} \\a_{2} \\ a_{3} \end{bmatrix}$$

There is also a straight line $l$ which is passing through point $A$ and has a direction vector $v$

$$v=\begin{bmatrix} v_{1} \\v_{2} \\ v_{3} \end{bmatrix}(\neq 0)$$

In the same space there is also exists another point (point $P$) which has a position vector $p$

$$p=\overrightarrow{OP}=\begin{bmatrix} p_{1} \\p_{2} \\ p_{3} \end{bmatrix}$$

Let's also assume that point $Q$ is a point on $l$ and is the closest point to $P$. Point $Q$ has a position vector $q$

$$q=\overrightarrow{OQ}=\begin{bmatrix} q_{1} \\q_{2} \\ q_{3} \end{bmatrix}$$

I am asked to rewrite $q$ to the form $q=Lp+b$, where matrix $L$ and vector $b$ are only determined by $l$.

I could only find that the equation for the straight line $l$ is

$$x=a_{1}+v_{1}t$$ $$y=a_{2}+v_{2}t$$ $$z=a_{3}+v_{3}t$$

and got stuck. Any suggestions?

This is a direct translation of the original problem. If something does not sound right, let me know.

2

There are 2 best solutions below

0
On BEST ANSWER

Let's get some intuition for the problem by solving it in the simpler case of when $a = 0$. In this case, $\ell$ goes through the origin, and $q$ must be of the form $q = vt$ for some yet unknown $t$. This $t$ is chosen such that the length $\|q-p\|$ is minimized. Equivalently, we can minimize $\|q-p\|^2$, which simplifies as such: $$ \begin{align} \|q-p\|^2 & = \|vt-p\|^2 = (vt-p)\cdot(vt-p) \\ & = \|v\|^2t^2 - 2(v\cdot p)t + \|p\|^2. \end{align} $$ This is a quadratic in $t$, and its minimum occurs at its vertex, at $$ t_{min} = -\frac{-2(v\cdot p)}{2\|v\|^2} = \frac{(v\cdot p)}{\|v\|^2}. $$ So, $$ q = vt_{min} = \frac{(p\cdot v)}{\|v\|^2}v. $$ In other words, when $a = 0$, $q$ is the projection of $p$ onto the span of $v$. Projection is a type of linear transformation, so in this case we'd expect that writing $q = Lp + b$ should have $b = 0$ and $L$ being the corresponding projection matrix.

A commonly known fact about matrices is that the columns are the coordinates of the images of the underlying basis vectors, in our case $e_1 = (1,0,0)$, etc. Plugging $e_1, e_2, e_3$ into our formula for $q$ therefore reveals that $$ L = \frac{1}{\|v\|^2}\begin{bmatrix} v_1^2 & v_1v_2 & v_1v_3 \\ v_1v_2 & v_2^2 & v_2v_3\\ v_1v_3 & v_2v_3 & v_3^2 \end{bmatrix}. $$ We verify that indeed, $Lp = q$ in this case: $$ \begin{align} Lp & = \frac{1}{\|v\|^2}\begin{bmatrix} v_1^2 & v_1v_2 & v_1v_3 \\ v_1v_2 & v_2^2 & v_2v_3\\ v_1v_3 & v_2v_3 & v_3^2 \end{bmatrix} \begin{bmatrix} p_1 \\ p_2 \\ p_3 \end{bmatrix} = \frac{1}{\|v\|^2}\begin{bmatrix} (p_1v_1 + p_2v_2 p_3v_3)v_1 \\ (p_1v_1 + p_2v_2 p_3v_3)v_2 \\ (p_1v_1 + p_2v_2 p_3v_3)v_3 \end{bmatrix} = \frac{(p\cdot v)}{\|v\|^2} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} \\ & = \frac{(p\cdot v)}{\|v\|^2}v = q. \end{align} $$

How about the case when $a$ is nonzero? Well, by translating the whole system by $-a$, this is equivalent to finding the "$q$" associated to $p-a$ in the "$a=0$" case, and then translating back by $a$. Therefore, in general, $$ q = a + L(p-a) = Lp + (a-La) = a + \frac{(p-a)\cdot v}{\|v\|^2}v. $$ That is, your final answer is $$ \boxed{L = \frac{1}{\|v\|^2}\begin{bmatrix} v_1^2 & v_1v_2 & v_1v_3 \\ v_1v_2 & v_2^2 & v_2v_3\\ v_1v_3 & v_2v_3 & v_3^2 \end{bmatrix} = \frac1{\|v\|^2}vv^T, \ \ b = a - La = a - \frac{(a\cdot v)}{\|v\|^2}v.} $$

0
On

Matrix $L$ represents the orthogonal projection onto direction $v$ in the canonical basis and can be determined as follows

  • consider an orthonormal basis $\mathcal B=\left\{\hat v=\frac v{|v|}, \hat u, \hat w\right\}$
  • the matrix $M=[\hat v \;\hat u\; \hat w]$ which represents the change of basis from $\mathcal B$ to the canonical
  • the matrix $P=\begin{bmatrix}1&0&0\\0&0&0\\0&0&0\end{bmatrix}$ which represents the orthogonal projection onto direction $v$ in the basis $\mathcal B$

therefore

$$L=MPM^T$$

Finally $b$ can be found as the intersection of line $l$ with the plane $v_1x+v_2y+v_3z=0$ passing through the origin and orthogonal to line $l$, which leads to

$$t_b=-\frac{a_1v_1+a_2v_2+a_3v_3}{v_1^2+v_2^2+v_3^2} \implies b=l(t_b)$$


Worked Example

Given

  • $a=(1,1,1)$
  • $v=(1,2,2)$

then

  1. an orthonormal basis $\mathcal B=\left\{\hat v=\frac v{|v|}, \hat u, \hat w\right\}$ is obtained by
  • $\hat v=\frac v{|v|}=\left(\frac13,\frac23,\frac23\right)$
  • $u=(2,-1,0)\implies \hat u=\frac u{|u|}=\left(\frac{2}{\sqrt 5},-\frac{1}{\sqrt 5},0\right)$
  • $w=v\times u=(2,4,-5)\implies \hat w=\frac w{|w|}=\left(\frac{2}{3\sqrt 5},\frac{4}{3\sqrt 5},-\frac{5}{3\sqrt 5}\right)$
  1. the matrix $M=[\hat v \;\hat u\; \hat w]$ which represents the change of basis from $\mathcal B$ to the canonical is

$$M=\begin{bmatrix}\frac13&\frac{2}{\sqrt 5}&\frac{2}{3\sqrt 5}\\\frac23&-\frac{1}{\sqrt 5}&\frac{4}{3\sqrt 5}\\\frac23&0&-\frac{5}{3\sqrt 5}\end{bmatrix}$$

  1. matrix $L$ which represents the orthogonal projection onto direction $v$ in the canonical basis is

$$L=MPM^T=\begin{bmatrix}\frac13&\frac{2}{\sqrt 5}&\frac{2}{3\sqrt 5}\\\frac23&-\frac{1}{\sqrt 5}&\frac{4}{3\sqrt 5}\\\frac23&0&-\frac{5}{3\sqrt 5}\end{bmatrix}\begin{bmatrix}1&0&0\\0&0&0\\0&0&0\end{bmatrix}\begin{bmatrix}\frac13&\frac{2}{\sqrt 5}&\frac{2}{3\sqrt 5}\\\frac23&-\frac{1}{\sqrt 5}&\frac{4}{3\sqrt 5}\\\frac23&0&-\frac{5}{3\sqrt 5}\end{bmatrix}^T=\frac19\begin{bmatrix}1&2&2\\2&4&4\\2&4&4\end{bmatrix}$$

  1. determine $b$

$$t_b=-\frac{a_1v_1+a_2v_2+a_3v_3}{v_1^2+v_2^2+v_3^2}=-\frac{5}{9}\implies b=a-\frac59 v =\left(\frac 4 9,-\frac 19, - \frac 1 9\right)$$

  1. assume for example $p=(3,4,5)$ then

$$q=Lp+b=\frac19\begin{bmatrix}1&2&2\\2&4&4\\2&4&4\end{bmatrix}\begin{bmatrix}3\\4\\5\end{bmatrix}+\begin{bmatrix}\frac 4 9\\-\frac 19\\- \frac 1 9\end{bmatrix}=\begin{bmatrix}\frac {25} 9\\\frac {41} 9\\\frac {41} 9\end{bmatrix}$$

As a check, note indeed that

$$(p-q)\cdot v= \begin{bmatrix}\frac {2} 9&-\frac {5} 9&\frac {4} 9\end{bmatrix}\begin{bmatrix}1\\2\\2\end{bmatrix}=0$$