Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Suppose I have two vectors that are not orthogonal (let's say, an isometric grid) representing the new axis. Suppose I want to project a point onto these two vectors, how would I do it? Dot product only works for projecting a point orthogonally onto a vector, but now I want to project a point such that it is not along the orthogonal line, but respected to another vector.

For example, I found this picture in wikipedia: http://en.wikipedia.org/wiki/Projection_(linear_algebra)#Classification

Suppose I have two vectors that point in the same direction as line k and m. If I want to project a point onto axis m, I want to project it such that it follows along k onto m, not orthogonally. Then I can have my k and m as my new axis, and all the points will be projected respected to these two vectors.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Let's call your two "axis" vectors $U$ and $V$. The nice folks around here would probably call them "basis" vectors. And suppose you have some other vector $W$, lying in the plane of $U$ and $V$, that you want to decompose.

Essentially, you want to find two numbers $h$ and $k$ such that $$W = hU + kV$$ The vector $hU$ will be the projection of $W$ onto the $U$-axis in a direction parallel to $V$, and $kV$ will be the projection of $W$ onto the $V$-axis in a direction parallel to $U$. Draw a picture and you'll see why this is so.

Take dot products of the equation above with $U$ and $V$ in turn, getting $$h(U \cdot U) + k(U \cdot V) = W \cdot U$$ $$h(V \cdot U) + k(V \cdot V) = W \cdot V$$ Now you have two simultaneous equations for $h$ and $k$, which are easy to solve (using Cramer's rule, for example).

Of course, all of this is much easier if $U$ and $V$ are perpendicular, because then
$U \cdot V$ is zero. If $U$ and $V$ have unit length, it gets even easier, because then $U \cdot U$ and $V \cdot V$ are both equal to 1.

share|improve this answer

Just directly building upon bubba's answer, in Matrix form this can be computed by doing $$Y = \left(M^TM\right)^{-1}M^TW$$ where $M=\left\{\begin{matrix} |\\ U \;|\; V \\ | \end{matrix}\right\}$ is the matrix that contains the basis vectors and $Y=\left\{\begin{matrix} h\\ k \end{matrix}\right\}$ is the projection of W (your original vector) on said basis.

share|improve this answer

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.