Orthogonal projection vectors: line and plane formulas with applications

Original publication: Updated:

What is an orthogonal projection?

An orthogonal projection is the component of a vector along a specified line or plane, obtained by dropping a perpendicular. Thinking of a shadow can help, provided the light rays are perpendicular to the receiving line or plane.

For a vector a\mathbf a and a nonzero direction vector l\mathbf l, the projection onto the line spanned by l\mathbf l is

proj⁡la=a⋅l∣l∣2l.\boxed{\operatorname{proj}_{\mathbf l}\mathbf a=\frac{\mathbf a\cdot\mathbf l}{|\mathbf l|^2}\mathbf l.}

The vector a in red and its orthogonal projection b in blue onto the line directed by l.

The same formula works in two or three dimensions. It is the dimension of the receiving subspace, rather than the dimension of the drawing, that determines which projection formula to use.

Deriving the line-projection formula

Write the projected vector as b=tl\mathbf b=t\mathbf l. Orthogonality requires the residual a−b\mathbf a-\mathbf b to be perpendicular to l\mathbf l, so

(a−tl)⋅l=0.(\mathbf a-t\mathbf l)\cdot\mathbf l=0.

Since l≠0\mathbf l\ne\mathbf0,

t=a⋅ll⋅l.t=\frac{\mathbf a\cdot\mathbf l}{\mathbf l\cdot\mathbf l}.

Substitution gives the formula above. This derivation also proves that it is the unique projection with the stated properties.

The geometric interpretation

If θ\theta is the angle between nonzero a\mathbf a and l\mathbf l, its signed component in the direction of l\mathbf l is

∣a∣cos⁡θ=a⋅l∣l∣.|\mathbf a|\cos\theta=\frac{\mathbf a\cdot\mathbf l}{|\mathbf l|}.

Multiply that scalar by the unit direction l/∣l∣\mathbf l/|\mathbf l| to recover the projection vector. If the dot product is negative, the projection points opposite to l\mathbf l; its length is still nonnegative.

The angle theta between a and the projection direction, showing the perpendicular drop.

When e\mathbf e is a unit vector, the formula simplifies to (a⋅e)e(\mathbf a\cdot\mathbf e)\mathbf e. The denominator in the general formula is ∣l∣2|\mathbf l|^2, not a vector square.

Projection onto a plane through the origin

Let n≠0\mathbf n\ne\mathbf0 be normal to a plane through the origin. Remove the component parallel to the normal:

proj⁡n⊥a=a−a⋅n∣n∣2n.\boxed{\operatorname{proj}_{\mathbf n^\perp}\mathbf a=\mathbf a-\frac{\mathbf a\cdot\mathbf n}{|\mathbf n|^2}\mathbf n.}

The resulting vector is in the plane because its dot product with n\mathbf n is zero. The removed component is perpendicular to that plane, which establishes the projection property.

The vector a split into a normal component in blue and a component parallel to the plane in green.

For a plane not passing through the origin, translate by a known point on the plane before applying this formula. A point and a free vector are different objects; the translation must not be omitted.

Example 1: a perpendicular foot on a line

Problem. In a triangle OABOAB, suppose OA=4OA=4 and OA→⋅OB→=3\overrightarrow{OA}\cdot\overrightarrow{OB}=3. Let PP be the foot of the perpendicular from BB to the line OAOA. Express OP→\overrightarrow{OP} as kOA→k\overrightarrow{OA}.

The vector OP→\overrightarrow{OP} is the projection of OB→\overrightarrow{OB} onto the direction OA→\overrightarrow{OA}. Thus

OP→=OB→⋅OA→∣OA→∣2OA→=316OA→.\overrightarrow{OP}=\frac{\overrightarrow{OB}\cdot\overrightarrow{OA}}{|\overrightarrow{OA}|^2}\overrightarrow{OA}=\boxed{\frac3{16}\overrightarrow{OA}.}

The length of OBOB is not needed. The given dot product already determines its component along OAOA.

Example 2: reflection across a plane

Problem. Let PP lie on a plane π\pi in three-dimensional space, and let n≠0\mathbf n\ne\mathbf0 be normal to π\pi. A point QQ has reflection Q′Q' across π\pi. With p=OP→\mathbf p=\overrightarrow{OP} and q=OQ→\mathbf q=\overrightarrow{OQ}, express OQ′→\overrightarrow{OQ'} in terms of p,q,n\mathbf p,\mathbf q,\mathbf n.

This is the plane-reflection problem discussed in the original article, attributed there to Kwansei Gakuin University's School of Business Administration.

Let MM be the midpoint of QQ′QQ', which is also the perpendicular foot of QQ on π\pi. The displacement from QQ to the plane is the component of QP→=p−q\overrightarrow{QP}=\mathbf p-\mathbf q along the normal:

QM→=(p−q)⋅n∣n∣2n.\overrightarrow{QM}=\frac{(\mathbf p-\mathbf q)\cdot\mathbf n}{|\mathbf n|^2}\mathbf n.

Since Q′=Q+2QM→Q'=Q+2\overrightarrow{QM},

OQ′→=q+2(p−q)⋅n∣n∣2n.\boxed{\overrightarrow{OQ'}=\mathbf q+2\frac{(\mathbf p-\mathbf q)\cdot\mathbf n}{|\mathbf n|^2}\mathbf n.}

Check both defining properties

The displacement Q′−QQ'-Q is parallel to the normal. Also, the midpoint has position vector

m=q+(p−q)⋅n∣n∣2n,\mathbf m=\mathbf q+\frac{(\mathbf p-\mathbf q)\cdot\mathbf n}{|\mathbf n|^2}\mathbf n,

and (m−p)⋅n=0(\mathbf m-\mathbf p)\cdot\mathbf n=0, so it lies on the plane. These two checks confirm that the construction is the desired reflection. If QQ already lies on the plane, the correction term vanishes and Q′=QQ'=Q.

A practical habit

Before calculating, identify the vector being projected, the receiving direction or plane, and whether a translation is needed. Afterward, check parallelism of the projected component and orthogonality of the residual. These conditions are often quicker to recall than a memorized formula.

Related: vector equations of planes and cross products.

Related articles

About the author

Koki Saito

Physician and graduate of the University of Tokyo Faculty of Medicine. Drawing on his entrance-exam experience, he explains how to choose mathematical methods and construct complete solutions.

Full profile →

Have a question or spotted an error? Contact us.