# How to project vector onto a plane but not along plane normal?

In 3d space, is there any way to project a vector onto a plane, but along the UP direction (0,1,0) instead of the plane normal? If so, how do I do that and what is it called?

• I am not sure what do you mean by up direction. But in general, projection of a vector on a plane can be found by the vector minus its projection on the normal. Apr 19, 2021 at 15:28
• @Benjamin_Gal I mean that instead of using the plane normal to project the vector onto the plane, you would use another vector (the up vector in this case). The resulting vector would have a different direction and magnitude as well. Apr 19, 2021 at 15:34

If I understand you correctly, you want to take an arbitrary vector $$\vec{v}$$ and decompose it as $$\vec{v} = \vec{w} + \alpha \vec{u}$$, where $$\vec{w}$$ lies in some plane with normal $$\vec{n}$$ (i.e., $$\vec{w} \cdot \vec{n} = 0$$), and $$\vec{u}$$ is a known vector, not necessarily equal to $$\vec{n}$$.

Since by assumption we have $$\vec{v} = \vec{w} + \alpha \vec{u}$$ and $$\vec{w} \cdot \vec{n} = 0$$, taking the dot product of both sides with $$\vec{n}$$ yields $$\vec{v} \cdot \vec{n} = \alpha \vec{u} \cdot \vec{n} \quad \Rightarrow \quad \alpha = \frac{\vec{v} \cdot \vec{n}}{\vec{u} \cdot \vec{n}}.$$ This then implies that the desired vector $$\vec{w}$$ will be $$\boxed{\vec{w} = \vec{v} - \left(\frac{\vec{v} \cdot \vec{n}}{\vec{u} \cdot \vec{n}} \right)\vec{u}.}$$

Note that in the case where $$\vec{u} = \vec{n}$$, this reduces to the standard orthogonal projection equation. Note also that in the case where $$\vec{u}\cdot\vec{n} = 0$$, this equation doesn't make any sense; this corresponds to the case where you're projecting along an axis lying parallel to the chosen plane, and so the desired vector $$\vec{w}$$ will not exist unless $$\vec{v}$$ already lies in that plane.

• Exactly what I was looking for, thanks! Apr 19, 2021 at 16:02

A picture would help, but this is what I think you are asking. Given the plane $$ax+by+cz = d$$ and the point $$(p,q,r)$$, you want to move the point in the direction $$(0,1,0)$$ until it meets the plane.

Well that move will change only the value of $$q$$, To find the new value, solve $$ap + b? + cr = d$$ for the value of $$?$$.

There will be no solution if $$(0,1,0)$$ is parallel to the plane (unless the point is in the plane to begin with).

In more generality, you are asking for the intersection of a line (through a given point in a given direction) with a plane.