
Douglas B. answered 05/12/20
Linear algebra tutor with masters degree in applied math
Hey Alex, your question is interesting. There is a general method for computing the projection of one vector onto another vector (n-dim space). The formula for the projection matrix for projecting vector v onto vector a is
P = a*a^T. The projection is then va = Pv.
In your problem, you are asking about a plane, which has normal vector n. So, I would recommend a three-stage process.
- Determine the normal vector n describing your plane. Note that this vector will not be unique (think of how there are an infinite number of vectors orthogonal to a line in 3-space).
- Compute the projection of your vector v onto n: vn = Pnv.
- Compute the projection onto the plane (vp) using the formula vp = v-vn.
Now, we can condense this process!
Note that vp = v-Pnv = (I-Pn)v. So, the matrix you are after is I-Pn = I-nn^T.
Hope this helps!

Douglas B.
identity matrix (4 by 4 in your case).05/15/20
Alex K.
HI thanks for your reply, could you explain more what is l in (I-Pn)v? thanks05/15/20