How do I solve for the projection of a vector on one axis mathematically?

779 Views Asked by At

If I have a vector $v$ = (x1, x2) and I want to find the matrix A so that I may express the projected vector on an axis (Y=AX), how would I do this mathematically?

If there is a line through the plane I can use P($v$)=$v$ + t$n$ and then use that in solving the lines equation. I then find t, which I can use in my P($v$) to get the matrix A.

But I don't know how to use it when there is only an axis. The only way I can find it is by using common sense (if there is a vector in (1, 1), the projected vector on axis x1 in the plane Pi = (x1, x2) will be (1, 0) from which I can construct a matrix A. How should I solve it? I am only a HS senior so please don't over-complicate things haha

2

There are 2 best solutions below

0
On

Given a vector, $v = \begin{bmatrix} x \\ y \end{bmatrix}$ find a 2x2 matrix, $A = \begin{bmatrix}a&b \\ c &d \end{bmatrix}$ such that $Av = \begin{bmatrix} 0 \\ y \end{bmatrix}$.

I guess you could multiply out the left hand side and simplify the resulting equations to find,

$A = \begin{bmatrix}0 & 0 \\ 0 & 1 \end{bmatrix}$ accomplishes the desired result but this seems easily observed and verified....

$\begin{bmatrix}0 & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 0 \\ y \end{bmatrix}$

0
On

Say you want to project onto the column vector $v$ orthogonally. This means we want to construct the matrix $P$ so that $Px=\lambda v$ and $P^2=P$. Let $u= v/v^Tv$ where $v^T$ is the transpose of $v$. Since $v^Tv$ is just the usual dot product we can interpret it as the length squared and see that $u$ must be a unit vector so that $u^Tu=1$.

I claim that $P=uu^T$ is the desired matrix. To see this we first derive some properties of of this matrix. Calculating directly we have that $P^2=(uu^T)^2=(uu^T)(uu^T)=u(u^Tu)u^T=uu^T=P$ so it is a projection. Finally to see that $Px = \lambda u$ simply note that $Px=(uu^T)x=u(u^Tx)$ so $\lambda = u^Tx$ and it projects onto the subspace generated by $u$, and therefore $v$.

Finally to see that it is the orthogonal projection we first see that $P$ is symmetric because $P^T=(uu^T)^T=(u^T)^Tu^T=uu^T=P$ and we will need to use $I$, the identity matrix. To be the orthogonal projection means that for any $x$ that $x-Px$ is orthogonal to $Px$ and that $Px + x - Px=x$. Since vectors $x$ and $y$are orthogonal if and only if $x^Ty=0$ we have to compute $$(Px)^T(x-Px) = x^TP(x-Px)=x^TP(I-P)=x^T(P^2-P)x=x^T(P-P)x=0$$ and so we have that $P$ is the orthogonal projection. Notice we never used the fact that the vectors were two dimensional, just that the base field was some subset of $\mathbb{R}$.