askvity

How to Find the Orthogonal Projection of a Vector?

Published in Vector Projection 4 mins read

To find the orthogonal projection of a vector onto another vector (or onto a line spanned by that vector), you use a specific formula involving the dot product and the magnitude squared of the vector you are projecting onto.

The orthogonal projection of a vector v onto a non-zero vector u, often denoted as proj_u v, is given by the formula:

$$ \text{proj}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{|\mathbf{u}|^2} \mathbf{u} $$

This formula determines the component of v that lies in the direction of u.

Understanding the Formula

Let's break down the components of the orthogonal projection formula:

  • v: The vector you want to project.
  • u: The vector onto which you are projecting v (this vector defines the direction or the line).
  • vu: The dot product of vectors v and u. This is a scalar value. It measures how much v points in the direction of u.
  • ||u||²: The squared magnitude (or squared length) of vector u. This is also a scalar value, calculated as uu.
  • $$ \frac{\mathbf{v} \cdot \mathbf{u}}{|\mathbf{u}|^2} $$: This entire fraction is a scalar. It represents the scalar projection of v onto u. It tells you how "long" the projection is along the direction of u (signed, meaning it could be negative if v points opposite to u).
  • $$ \left( \frac{\mathbf{v} \cdot \mathbf{u}}{|\mathbf{u}|^2} \right) \mathbf{u} $$: The scalar projection is multiplied by the vector u. This scales the direction vector u by the calculated scalar length, resulting in a vector that is parallel to u and has the correct length and direction of the projection.

Steps to Calculate Orthogonal Projection

To calculate the orthogonal projection of v onto u:

  1. Calculate the dot product vu.
  2. Calculate the magnitude squared of u, which is ||u||² = uu.
  3. Divide the dot product (vu) by the magnitude squared (||u||²). This gives you the scalar multiplier.
  4. Multiply the result from step 3 by the vector u.

The resulting vector is the orthogonal projection of v onto u.

Context from the Reference

The provided reference mentions finding the orthogonal projection of vector x onto a line l where vector u is an orthogonal basis for the line. This aligns perfectly with the formula described above. If a line l is defined by a single vector u, then u serves as an orthogonal basis for that line. Therefore, the projection of vector x onto the line l is simply the projection of x onto the vector u, which is calculated using the formula:

$$ \text{proj}_{\mathbf{u}} \mathbf{x} = \frac{\mathbf{x} \cdot \mathbf{u}}{|\mathbf{u}|^2} \mathbf{u} $$

As stated in the reference, "Here is that vector u because we have a single vector is an orthogonal basis for the line l and therefore the projection formula does apply applying the formula the orthogonal projection of vector x".

Example

Let's find the orthogonal projection of vector v = <4, 2> onto vector u = <3, 0>.

  1. Calculate the dot product vu:
    vu = (4 3) + (2 0) = 12 + 0 = 12

  2. Calculate the magnitude squared of u:
    ||u||² = uu = (3 3) + (0 0) = 9 + 0 = 9

  3. Divide the dot product by the magnitude squared:
    Scalar multiplier = (12) / (9) = 12/9 = 4/3

  4. Multiply the result by vector u:
    proj_u v = (4/3) <3, 0> = <(4/3)3, (4/3)*0> = <4, 0>

So, the orthogonal projection of <4, 2> onto <3, 0> is <4, 0>.

Orthogonal Projection

Related Articles