Skip to content
LoveToCalc

Theorem — what does that mean?

Orthogonal projection onto a subspace

The orthogonal projection of a vector onto a subspace is the point of the subspace closest to it. With an orthogonal basis it is a sum of projections onto lines.

In Swedish: Ortogonal projektion på ett underrum

Orthogonal projection onto a subspace

The relation

(ŷ₁, ŷ₂, ŷ₃)=(y₁, y₂, y₃)·(u₁, u₂, u₃)(u₁, u₂, u₃)·(u₁, u₂, u₃)·(u₁, u₂, u₃)+(y₁, y₂, y₃)·(v₁, v₂, v₃)(v₁, v₂, v₃)·(v₁, v₂, v₃)·(v₁, v₂, v₃)

If u and v are an orthogonal basis of a subspace W, the orthogonal projection of y onto W is the sum of the projections onto the two lines: ŷ = (y·u/u·u)u + (y·v/v·v)v. It is the point of W closest to y.

Solved for ŷ

ŷ=(y₁u₁+y₂u₂+y₃u₃u₁u₁+u₂u₂+u₃u₃u₁+y₁v₁+y₂v₂+y₃v₃v₁v₁+v₂v₂+v₃v₃v₁, y₁u₁+y₂u₂+y₃u₃u₁u₁+u₂u₂+u₃u₃u₂+y₁v₁+y₂v₂+y₃v₃v₁v₁+v₂v₂+v₃v₃v₂, y₁u₁+y₂u₂+y₃u₃u₁u₁+u₂u₂+u₃u₃u₃+y₁v₁+y₂v₂+y₃v₃v₁v₁+v₂v₂+v₃v₃v₃)

ŷ=(−0.4, 2, 0.2)

ŷ equals the vector (((((((1 times 2) plus (2 times 5)) plus (3 times (−1))) divided by (((2 times 2) plus (5 times 5)) plus ((−1) times (−1)))) times 2) plus (((((1 times (−2)) plus (2 times 1)) plus (3 times 1)) divided by ((((−2) times (−2)) plus (1 times 1)) plus (1 times 1))) times (−2))), ((((((1 times 2) plus (2 times 5)) plus (3 times (−1))) divided by (((2 times 2) plus (5 times 5)) plus ((−1) times (−1)))) times 5) plus (((((1 times (−2)) plus (2 times 1)) plus (3 times 1)) divided by ((((−2) times (−2)) plus (1 times 1)) plus (1 times 1))) times 1)), ((((((1 times 2) plus (2 times 5)) plus (3 times (−1))) divided by (((2 times 2) plus (5 times 5)) plus ((−1) times (−1)))) times (−1)) plus (((((1 times (−2)) plus (2 times 1)) plus (3 times 1)) divided by ((((−2) times (−2)) plus (1 times 1)) plus (1 times 1))) times 1))), equals the vector ((((((2 plus 10) plus (−3)) divided by ((4 plus 25) plus 1)) times 2) plus (((((−2) plus 2) plus 3) divided by ((4 plus 1) plus 1)) times (−2))), (((((2 plus 10) plus (−3)) divided by ((4 plus 25) plus 1)) times 5) plus (((((−2) plus 2) plus 3) divided by ((4 plus 1) plus 1)) times 1)), (((((2 plus 10) plus (−3)) divided by ((4 plus 25) plus 1)) times (−1)) plus (((((−2) plus 2) plus 3) divided by ((4 plus 1) plus 1)) times 1))), equals the vector (((((12 plus (−3)) divided by (29 plus 1)) times 2) plus (((0 plus 3) divided by (5 plus 1)) times (−2))), ((((12 plus (−3)) divided by (29 plus 1)) times 5) plus (((0 plus 3) divided by (5 plus 1)) times 1)), ((((12 plus (−3)) divided by (29 plus 1)) times (−1)) plus (((0 plus 3) divided by (5 plus 1)) times 1))), equals the vector ((((9 divided by 30) times 2) plus ((3 divided by 6) times (−2))), (((9 divided by 30) times 5) plus ((3 divided by 6) times 1)), (((9 divided by 30) times (−1)) plus ((3 divided by 6) times 1))), equals the vector (((0.3 times 2) plus (0.5 times (−2))), ((0.3 times 5) plus (0.5 times 1)), ((0.3 times (−1)) plus (0.5 times 1))), equals the vector ((0.6 plus (−1)), (1.5 plus 0.5), (−0.3 plus 0.5)), equals the vector (−0.4, 2, 0.2)

Working7 steps

Practice questions

You are given

  • y₁=0
  • y₂=1
  • y₃=-3
  • u₁=2
  • u₂=-1
  • u₃=1
  • v₁=1
  • v₂=1
  • v₃=-1
Your answer: Orthogonal projection of y onto W ŷ

The formula

Let W be a subspace with an orthogonal basis u, v, which means u·v = 0. The orthogonal projection of y onto W is

Each term is the vector projection of y onto one of the lines. The vector y − ŷ is orthogonal to W and its length is the distance from y to W, so ŷ is the point of W closest to y. The card above takes y, u and v in ℝ³ and gives ŷ. With a longer basis, add one term per basis vector.

Holds when u and v are orthogonal and not zero. If they are not, the card refuses; see the second example.

Worked example

u = (2, 5, −1), v = (−2, 1, 1) and y = (1, 2, 3). First u·v = −4 + 5 − 1 = 0, so the basis is orthogonal. Then

Check: y − ŷ = (1.4, 0, 2.8). Its dot product with u is 2.8 + 0 − 2.8 = 0, and with v it is −2.8 + 0 + 2.8 = 0. The distance from y to W is √(1.4² + 2.8²) = √9.8 ≈ 3.13.

A second example: when the basis is not orthogonal

Take u = (1, 0) and v = (1, 1) in the plane, where u·v = 1 is not 0. They span all of ℝ², so the projection of y = (0, 2) onto the plane is y itself. The sum of the line projections is (0, 0) + (1, 1) = (1, 1), which is a different vector. The sum formula needs an orthogonal basis.

The fix is Gram–Schmidt: keep u and replace v by v − (v·u/u·u)u = (1, 1) − 1·(1, 0) = (0, 1). The new basis is orthogonal, and the sum gives (0, 0) + (2/1)(0, 1) = (0, 2).

A projection onto a coordinate plane is the simplest case. With u = (1, 0, 0) and v = (0, 1, 0), the projection of (3, 4, 5) is (3, 4, 0): the third coordinate is dropped.

Basis Formula for the projection
One vector u (y·u / u·u) u, the vector projection
Orthogonal u, v (y·u / u·u) u + (y·v / v·v) v
Orthonormal u, v (lengths 1) (y·u) u + (y·v) v
Any basis solve the normal equations, see least squares

Common mistakes

Frequently asked questions

How do I project onto a subspace if I do not have an orthogonal basis? Make one with Gram–Schmidt, or put the basis vectors as the columns of A and solve the normal equations AᵀA x̂ = Aᵀy. The projection is then Ax̂.

Why does the sum of two projections work only for an orthogonal basis? Each term is the part of y along one basis vector. Basis vectors that are not orthogonal share a direction, and that part of y is counted twice. Orthogonal vectors share none.

What is the orthogonal complement? The vectors orthogonal to every vector in W. Every y splits as ŷ + (y − ŷ), with ŷ in W and y − ŷ in the complement.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
ŷ₁y₁u₁+y₂u₂+y₃u₃u₁u₁+u₂u₂+u₃u₃u₁+y₁v₁+y₂v₂+y₃v₃v₁v₁+v₂v₂+v₃v₃v₁1·2+2·5+3·(−1)2·2+5·5+(−1)·(−1)·2+1·(−2)+2·1+3·1−2·(−2)+1·1+1·1·(−2)−0.4
ŷ₂y₁u₁+y₂u₂+y₃u₃u₁u₁+u₂u₂+u₃u₃u₂+y₁v₁+y₂v₂+y₃v₃v₁v₁+v₂v₂+v₃v₃v₂1·2+2·5+3·(−1)2·2+5·5+(−1)·(−1)·5+1·(−2)+2·1+3·1−2·(−2)+1·1+1·1·12
ŷ₃y₁u₁+y₂u₂+y₃u₃u₁u₁+u₂u₂+u₃u₃u₃+y₁v₁+y₂v₂+y₃v₃v₁v₁+v₂v₂+v₃v₃v₃1·2+2·5+3·(−1)2·2+5·5+(−1)·(−1)·(−1)+1·(−2)+2·1+3·1−2·(−2)+1·1+1·1·10.2

Last reviewed November 7, 2026 ·How pages are reviewed

Linear algebraAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.