Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is a n-dimensional space: There's a point

$P (p_1,p_2,\dots,p_n)$

And two orthogonal vectors that determines a 2-D plane/subspace D

$v (v_1,v_2, \dots ,v_n)$ $w (w_1,w_2, \dots ,w_n)$

How do I project the point $P$ onto the 2-D subspace D that is determined by vector $v$ and $w$?

share|cite|improve this question
$\Pi_D P = \frac{\langle P, w\rangle}{\langle w,w\rangle} w + \frac{\langle P, v\rangle}{\langle v,v\rangle} v$ – martini Aug 22 '12 at 19:29
$\langle P, w\rangle = \sum_i p_iw_i$, the inner product of $P$ and $w$. – martini Aug 22 '12 at 19:41
@Michael, $v$ and $w$ are stated to be orthogonal in the question. – Rahul Aug 22 '12 at 21:16
@Hi271 when $v, w$ are orthogonal, then $M^T M = I$ in Michael's answer, and the formula simplify to martini's comment. – user2468 Aug 22 '12 at 22:23
OK, I missed that point. @JenniferDylan : You won't get $I$ unless $v,w$ are unit vectors, but you get a diagonal matrix. – Michael Hardy Aug 22 '12 at 23:43
up vote 6 down vote accepted

If you know matrices, this will do it: Regard $P$, $v$, and $w$ are column vectors. Let $M$ be the matrix whose two columns are $v$ and $w$. It's an $n\times2$ matrix. (By the way, you shouldn't use capital $N$ and lower-case $n$ as if they were synonymous. Mathematical notation is case-sensitive.) Then $M^TM$ is a $2\times 2$ matrix, which is invertible if the vectors $v$, $w$ are linearly independent. The matrix $M(M^TM)^{-1}M^T$ is and $n\times n$ matrix of rank $2$. The vector $M(M^TM)^{-1}M^T P$ is the projection that you seek.

"Usage note": Once upon a time a highly respected and moderately famous mathematician told me that $M(M^TM)^{-1}M^T$ is the identity matrix. Apparently he was assuming $M$ was a square matrix. I have a bold hypothesis, which I haven't checked empirically: "Pure" mathematicians tacitly assume matrices are square; "applied" mathematicians don't.

share|cite|improve this answer
Thank you very much! – Hi271 Aug 22 '12 at 22:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.