# Vector projection

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Vector_projection
> Markdown URL: https://mediated.wiki/source/Vector_projection.md
> Source: https://en.wikipedia.org/wiki/Vector_projection
> Source revision: 1351643651
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Concept in linear algebra

For broader coverage of this topic, see [Projection (linear algebra)](/source/Projection_(linear_algebra)) and [Projection (mathematics)](/source/Projection_(mathematics)).

This article's lead section may be too long. Please read the length guidelines and help move details into the article's body. (September 2024) (Learn how and when to remove this message)

The **vector projection** (also known as the **vector component** or **vector resolution**) of a [vector](/source/Vector_(geometry)) **a** on (or onto) a non-[zero](/source/Zero_vector) vector **b** is the [orthogonal projection](/source/Orthogonal_projection) of **a** onto a [straight line](/source/Straight_line) parallel to **b**. The projection of **a** onto **b** is often written as proj b ⁡ a {\displaystyle \operatorname {proj} _{\mathbf {b} }\mathbf {a} } or **a**∥**b**.

The vector component or vector resolute of **a** [perpendicular](/source/Perpendicular) to **b**, sometimes also called the **vector rejection** of **a** *from* **b** (denoted oproj b ⁡ a {\displaystyle \operatorname {oproj} _{\mathbf {b} }\mathbf {a} } or **a**⊥**b**),[1] is the orthogonal projection of **a** onto the [plane](/source/Plane_(geometry)) (or, in general, [hyperplane](/source/Hyperplane)) that is [orthogonal](/source/Orthogonal) to **b**. Since both proj b ⁡ a {\displaystyle \operatorname {proj} _{\mathbf {b} }\mathbf {a} } and oproj b ⁡ a {\displaystyle \operatorname {oproj} _{\mathbf {b} }\mathbf {a} } are vectors, and their sum is equal to **a**, the rejection of **a** from **b** is given by: oproj b ⁡ a = a − proj b ⁡ a . {\displaystyle \operatorname {oproj} _{\mathbf {b} }\mathbf {a} =\mathbf {a} -\operatorname {proj} _{\mathbf {b} }\mathbf {a} .}

Projection of **a** on **b** (**a**1), and rejection of **a** from **b** (**a**2)

When 90° < *θ* ≤ 180°, **a**1 has an opposite direction with respect to **b**.

To simplify notation, this article defines a 1 := proj b ⁡ a {\displaystyle \mathbf {a} _{1}:=\operatorname {proj} _{\mathbf {b} }\mathbf {a} } and a 2 := oproj b ⁡ a . {\displaystyle \mathbf {a} _{2}:=\operatorname {oproj} _{\mathbf {b} }\mathbf {a} .} Thus, the vector a 1 {\displaystyle \mathbf {a} _{1}} is parallel to b , {\displaystyle \mathbf {b} ,} the vector a 2 {\displaystyle \mathbf {a} _{2}} is orthogonal to b , {\displaystyle \mathbf {b} ,} and a = a 1 + a 2 . {\displaystyle \mathbf {a} =\mathbf {a} _{1}+\mathbf {a} _{2}.}

The projection of **a** onto **b** can be decomposed into a direction and a scalar magnitude by writing it as a 1 = a 1 b ^ {\displaystyle \mathbf {a} _{1}=a_{1}\mathbf {\hat {b}} } where a 1 {\displaystyle a_{1}} is a scalar, called the *[scalar projection](/source/Scalar_projection)* of **a** onto **b**, and **b̂** is the [unit vector](/source/Unit_vector) in the direction of **b**. The scalar projection is defined as[2] a 1 = ‖ a ‖ cos ⁡ θ = a ⋅ b ^ {\displaystyle a_{1}=\left\|\mathbf {a} \right\|\cos \theta =\mathbf {a} \cdot \mathbf {\hat {b}} } where the operator **⋅** denotes a [dot product](/source/Dot_product), ‖**a**‖ is the [length](/source/Euclidean_norm) of **a**, and *θ* is the [angle](/source/Angle) between **a** and **b**. The scalar projection is equal in absolute value to the length of the vector projection, with a minus sign if the direction of the projection is [opposite](/source/Opposite_vector) to the direction of **b**, that is, if the angle between the vectors is more than 90 degrees.

The vector projection can be calculated using the dot product of a {\displaystyle \mathbf {a} } and b {\displaystyle \mathbf {b} } as: proj b ⁡ a = ( a ⋅ b ^ ) b ^ = a ⋅ b ‖ b ‖ b ‖ b ‖ = a ⋅ b ‖ b ‖ 2 b = a ⋅ b b ⋅ b b . {\displaystyle \operatorname {proj} _{\mathbf {b} }\mathbf {a} =\left(\mathbf {a} \cdot \mathbf {\hat {b}} \right)\mathbf {\hat {b}} ={\frac {\mathbf {a} \cdot \mathbf {b} }{\left\|\mathbf {b} \right\|}}{\frac {\mathbf {b} }{\left\|\mathbf {b} \right\|}}={\frac {\mathbf {a} \cdot \mathbf {b} }{\left\|\mathbf {b} \right\|^{2}}}{\mathbf {b} }={\frac {\mathbf {a} \cdot \mathbf {b} }{\mathbf {b} \cdot \mathbf {b} }}{\mathbf {b} }~.}

## Notation

This article uses the convention that vectors are denoted in a bold font (e.g. **a**1), and scalars are written in normal font (e.g. *a*1).

The dot product of vectors **a** and **b** is written as a ⋅ b {\displaystyle \mathbf {a} \cdot \mathbf {b} } , the norm of **a** is written ‖**a**‖, and the angle between **a** and **b** is denoted by *θ*.

## Definitions based on angle *alpha*

### Scalar projection

Main article: [Scalar projection](/source/Scalar_projection)

The scalar projection of **a** on **b** is a scalar equal to a 1 = ‖ a ‖ cos ⁡ θ , {\displaystyle a_{1}=\left\|\mathbf {a} \right\|\cos \theta ,} where *θ* is the angle between **a** and **b**.

A scalar projection can be used as a [scale factor](/source/Scale_factor) to compute the corresponding vector projection.

### Vector projection

The vector projection of **a** on **b** is a vector whose magnitude is the scalar projection of **a** on **b** with the same direction as **b**. Namely, it is defined as a 1 = a 1 b ^ = ( ‖ a ‖ cos ⁡ θ ) b ^ {\displaystyle \mathbf {a} _{1}=a_{1}\mathbf {\hat {b}} =(\left\|\mathbf {a} \right\|\cos \theta )\mathbf {\hat {b}} } where a 1 {\displaystyle a_{1}} is the corresponding scalar projection, as defined above, and b ^ {\displaystyle \mathbf {\hat {b}} } is the [unit vector](/source/Unit_vector) with the same direction as **b**: b ^ = b ‖ b ‖ {\displaystyle \mathbf {\hat {b}} ={\frac {\mathbf {b} }{\left\|\mathbf {b} \right\|}}}

### Vector rejection

By definition, the vector rejection of **a** on **b** is: a 2 = a − a 1 {\displaystyle \mathbf {a} _{2}=\mathbf {a} -\mathbf {a} _{1}}

Hence, a 2 = a − ( ‖ a ‖ cos ⁡ θ ) b ^ {\displaystyle \mathbf {a} _{2}=\mathbf {a} -\left(\left\|\mathbf {a} \right\|\cos \theta \right)\mathbf {\hat {b}} }

## Definitions in terms of a and b

When θ is not known, the cosine of θ can be computed in terms of **a** and **b**, by the following property of the [dot product](/source/Dot_product) **a** ⋅ **b** a ⋅ b = ‖ a ‖ ‖ b ‖ cos ⁡ θ {\displaystyle \mathbf {a} \cdot \mathbf {b} =\left\|\mathbf {a} \right\|\left\|\mathbf {b} \right\|\cos \theta }

### Scalar projection

By the above-mentioned property of the dot product, the definition of the scalar projection becomes:[2] a 1 = ‖ a ‖ cos ⁡ θ = a ⋅ b ‖ b ‖ . {\displaystyle {\displaystyle a_{1}=\left\|\mathbf {a} \right\|\cos \theta ={\frac {\mathbf {a} \cdot \mathbf {b} }{\left\|\mathbf {b} \right\|}}.}}

In two dimensions, this becomes a 1 = a x b x + a y b y ‖ b ‖ . {\displaystyle a_{1}={\frac {\mathbf {a} _{x}\mathbf {b} _{x}+\mathbf {a} _{y}\mathbf {b} _{y}}{\left\|\mathbf {b} \right\|}}.}

### Vector projection

Similarly, the definition of the vector projection of **a** onto **b** becomes:[2] a 1 = a 1 b ^ = a ⋅ b ‖ b ‖ b ‖ b ‖ , {\displaystyle \mathbf {a} _{1}=a_{1}\mathbf {\hat {b}} ={\frac {\mathbf {a} \cdot \mathbf {b} }{\left\|\mathbf {b} \right\|}}{\frac {\mathbf {b} }{\left\|\mathbf {b} \right\|}},} which is equivalent to either a 1 = ( a ⋅ b ^ ) b ^ , {\displaystyle \mathbf {a} _{1}=\left(\mathbf {a} \cdot \mathbf {\hat {b}} \right)\mathbf {\hat {b}} ,} or[3] a 1 = a ⋅ b ‖ b ‖ 2 b = a ⋅ b b ⋅ b b . {\displaystyle \mathbf {a} _{1}={\frac {\mathbf {a} \cdot \mathbf {b} }{\left\|\mathbf {b} \right\|^{2}}}{\mathbf {b} }={\frac {\mathbf {a} \cdot \mathbf {b} }{\mathbf {b} \cdot \mathbf {b} }}{\mathbf {b} }~.}

### Scalar rejection

In two dimensions, the scalar rejection is equivalent to the projection of **a** onto b ⊥ = ( − b y b x ) {\displaystyle \mathbf {b} ^{\perp }={\begin{pmatrix}-\mathbf {b} _{y}&\mathbf {b} _{x}\end{pmatrix}}} , which is b = ( b x b y ) {\displaystyle \mathbf {b} ={\begin{pmatrix}\mathbf {b} _{x}&\mathbf {b} _{y}\end{pmatrix}}} rotated 90° to the left. Hence, a 2 = ‖ a ‖ sin ⁡ θ = a ⋅ b ⊥ ‖ b ‖ = a y b x − a x b y ‖ b ‖ . {\displaystyle a_{2}=\left\|\mathbf {a} \right\|\sin \theta ={\frac {\mathbf {a} \cdot \mathbf {b} ^{\perp }}{\left\|\mathbf {b} \right\|}}={\frac {\mathbf {a} _{y}\mathbf {b} _{x}-\mathbf {a} _{x}\mathbf {b} _{y}}{\left\|\mathbf {b} \right\|}}.}

Such a dot product is called the "perp dot product."

### Vector rejection

By definition, a 2 = a − a 1 {\displaystyle \mathbf {a} _{2}=\mathbf {a} -\mathbf {a} _{1}}

Hence, a 2 = a − a ⋅ b b ⋅ b b . {\displaystyle \mathbf {a} _{2}=\mathbf {a} -{\frac {\mathbf {a} \cdot \mathbf {b} }{\mathbf {b} \cdot \mathbf {b} }}{\mathbf {b} }.}

By using the Scalar rejection using the perp dot product this gives

a 2 = a ⋅ b ⊥ b ⋅ b b ⊥ {\displaystyle \mathbf {a} _{2}={\frac {\mathbf {a} \cdot \mathbf {b} ^{\perp }}{\mathbf {b} \cdot \mathbf {b} }}\mathbf {b} ^{\perp }}

## Properties

If 0° ≤ *θ* ≤ 90°, as in this case, the [scalar projection](/source/Scalar_projection) of **a** on **b** coincides with the [length](/source/Euclidean_norm) of the vector projection.

### Scalar projection

Main article: [Scalar projection](/source/Scalar_projection)

The scalar projection **a** on **b** is a scalar which has a negative sign if [90 degrees](/source/Right_angle) < *θ* ≤ [180 degrees](/source/Straight_angle). It coincides with the [length](/source/Euclidean_norm) ‖**c**‖ of the vector projection if the angle is smaller than 90°. More exactly:

- *a*1 = ‖**a**1‖ if 0° ≤ *θ* ≤ 90°,

- *a*1 = −‖**a**1‖ if 90° < *θ* ≤ 180°.

### Vector projection

The vector projection of **a** on **b** is a vector **a**1 which is either null or parallel to **b**. More exactly:

- **a**1 = **0** if *θ* = 90°,

- **a**1 and **b** have the same direction if 0° ≤ *θ* < 90°,

- **a**1 and **b** have opposite directions if 90° < *θ* ≤ 180°.

### Vector rejection

The vector rejection of **a** on **b** is a vector **a**2 which is either null or orthogonal to **b**. More exactly:

- **a**2 = **0** if *θ* = 0° or *θ* = 180°,

- **a**2 is orthogonal to **b** if 0 < *θ* < 180°,

## Matrix representation

The orthogonal projection can be represented by a [projection matrix](/source/Projection_(linear_algebra)). To project a vector onto the unit vector **a** = (*ax, ay, az*), it would need to be multiplied with this projection matrix:

## Uses

The vector projection is an important operation in the [Gram–Schmidt](/source/Gram%E2%80%93Schmidt_process) [orthonormalization](/source/Orthonormality) of [vector space](/source/Vector_space) [bases](/source/Basis_(linear_algebra)). It is also used in the [separating axis theorem](/source/Separating_axis_theorem) to detect whether two convex shapes intersect.

## Generalizations

Since the notions of vector [length](/source/Length) and [angle](/source/Angle) between vectors can be generalized to any *n*-dimensional [inner product space](/source/Inner_product_space), this is also true for the notions of orthogonal projection of a vector, projection of a vector onto another, and rejection of a vector from another.

### Vector projection on a plane

In some cases, the inner product coincides with the dot product. Whenever they don't coincide, the inner product is used instead of the dot product in the formal definitions of projection and rejection. For a three-dimensional [inner product space](/source/Inner_product_space), the notions of projection of a vector onto another and rejection of a vector from another can be generalized to the notions of projection of a vector onto a [plane](/source/Plane_(geometry)), and rejection of a vector from a plane.[4] The projection of a vector on a plane is its [orthogonal projection](/source/Orthogonal_projection) on that plane. The rejection of a vector from a plane is its orthogonal projection on a straight line which is orthogonal to that plane. Both are vectors. The first is parallel to the plane, the second is orthogonal.

For a given vector and plane, the sum of projection and rejection is equal to the original vector. Similarly, for inner product spaces with more than three dimensions, the notions of projection onto a vector and rejection from a vector can be generalized to the notions of projection onto a [hyperplane](/source/Hyperplane), and rejection from a [hyperplane](/source/Hyperplane). In [geometric algebra](/source/Geometric_algebra), they can be further generalized to the notions of [projection and rejection](/source/Geometric_algebra#Projection_and_rejection) of a general multivector onto/from any invertible *k*-blade.

## See also

- [Scalar projection](/source/Scalar_projection)

- [Vector notation](/source/Vector_notation)

## References

1. **[^](#cite_ref-1)** Perwass, G. (2009). [*Geometric Algebra With Applications in Engineering*](https://books.google.com/books?id=8IOypFqEkPMC&pg=PA83). Springer. p. 83. [ISBN](/source/ISBN_(identifier)) [9783540890676](https://en.wikipedia.org/wiki/Special:BookSources/9783540890676).

1. ^ [***a***](#cite_ref-:1_2-0) [***b***](#cite_ref-:1_2-1) [***c***](#cite_ref-:1_2-2) ["Scalar and Vector Projections"](https://www.ck12.org/book/ck-12-college-precalculus/section/9.6/). *www.ck12.org*. Retrieved 2020-09-07.

1. **[^](#cite_ref-3)** ["Dot Products and Projections"](https://web.archive.org/web/20160531080405/http://math.oregonstate.edu/home/programs/undergrad/CalculusQuestStudyGuides/vcalc/dotprod/dotprod.html). Archived from [the original](http://www.math.oregonstate.edu/home/programs/undergrad/CalculusQuestStudyGuides/vcalc/dotprod/dotprod.html) on 2016-05-31. Retrieved 2010-09-05.

1. **[^](#cite_ref-4)** M.J. Baker, 2012. [Projection of a vector onto a plane.](http://www.euclideanspace.com/maths/geometry/elements/plane/lineOnPlane/index.htm) Published on www.euclideanspace.com.

## External links

- [Projection of a vector onto a plane](http://www.euclideanspace.com/maths/geometry/elements/plane/lineOnPlane/index.htm)

v t e Linear algebra Outline Glossary Template:Matrix classes Linear equations Linear equation System of linear equations Determinant Minor Cauchy–Binet formula Cramer's rule Gaussian elimination Gauss–Jordan elimination Overcompleteness Strassen algorithm Matrices Matrix Matrix addition Matrix multiplication Basis transformation matrix Characteristic polynomial Spectrum Trace Eigenvalue, eigenvector and eigenspace Cayley–Hamilton theorem Jordan normal form Weyr canonical form Rank Inverse, Pseudoinverse Adjugate, Transpose Dot product Symmetric matrix, Skew-symmetric matrix Orthogonal matrix, Unitary matrix Hermitian matrix, Antihermitian matrix Positive-(semi)definite Pfaffian Projection Spectral theorem Perron–Frobenius theorem Diagonal matrix, Triangular matrix, Tridiagonal matrix Block matrix Sparse matrix Hessenberg matrix, Hessian matrix Vandermonde matrix Stochastic matrix, Toeplitz matrix, Circulant matrix, Hankel matrix (0,1)-matrix List of matrices Matrix decompositions Cholesky decomposition LU decomposition QR decomposition Polar decomposition Spectral theorem Singular value decomposition Higher-order singular value decomposition Schur decomposition Schur complement Haynsworth inertia additivity formula Reducing subspace Relations and computations Matrix equivalence Matrix congruence Matrix similarity Matrix consimilarity Row equivalence Elementary row operations Householder transformation Least squares Linear least squares Gram–Schmidt process Woodbury matrix identity Vector spaces Vector space Linear combination Linear span Linear independence Basis, Hamel basis Change of basis Dimension theorem for vector spaces Hamel dimension Examples of vector spaces Linear map Shear mapping Squeeze mapping Linear subspace Row and column spaces, Null space Rank–nullity theorem Nullity theorem Cyclic subspace Dual space, Linear functional Category of vector spaces Structures Topological vector space Normed vector space Inner product space Euclidean space Orthogonality Orthogonal complement Orthogonal projection Orthogonal group Pseudo-Euclidean space Null vector Indefinite orthogonal group Orientation Improper rotation Symplectic structure Multilinear algebra Multilinear algebra Tensor Tensors (classical) Component-free treatment of tensors Outer product Tensor algebra Exterior algebra Symmetric algebra Clifford algebra Geometric algebra Bivector Multivector Gamas's theorem Affine and projective Affine space Affine transformation, Affine group, Affine geometry Affine coordinate system, Flat (geometry) Cartesian coordinate system Euclidean group Poincaré group Galilean group Projective space Projective transformation Projective geometry Projective linear group Quadric Numerical linear algebra Numerical linear algebra Floating-point arithmetic Numerical stability Basic Linear Algebra Subprograms Sparse matrix Comparison of linear algebra libraries Category

---
Adapted from the Wikipedia article [Vector projection](https://en.wikipedia.org/wiki/Vector_projection) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Vector_projection?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
