The vector projection of a vector a onto a nonzero vector b is the orthogonal projection of a onto a line parallel to b, written as projb a
. Its complement, the vector rejection or vector component oprojb a, is the projection of a onto the plane orthogonal to b. These satisfy a = projb a + oprojb a
, where the projection is parallel and the rejection is orthogonal to b. The projection can be expressed as projb a = (a · b / b · b) b
, using the dot product. The scalar projection, defined as a₁ = ‖a‖ cosθ = a · 𝑏̂
, measures the magnitude of the projection in the direction of the unit vector 𝑏̂ along b.
Notation
This article uses the convention that vectors are denoted in a bold font (e.g. a1), and scalars are written in normal font (e.g. a1).
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‖, the angle between a and b is denoted θ.
Definitions based on angle θ
Scalar projection
Main article: 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 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 with the same direction as b: b ^ = b ‖ b ‖ {\displaystyle \mathbf {\hat {b}} ={\frac {\mathbf {b} }{\left\|\mathbf {b} \right\|}}}
Vector projection
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 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:3 a 1 = ‖ a ‖ cos θ = a ⋅ b ‖ b ‖ . {\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:4 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}} ,} or5 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."6
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
Scalar projection
Main article: Scalar projection
The scalar projection a on b is a scalar which has a negative sign if 90 degrees < θ ≤ 180 degrees. It coincides with the length ‖c‖ of the vector projection if the angle is smaller than 90°. More exactly:
- a1 = ‖a1‖ if 0° ≤ θ ≤ 90°,
- a1 = −‖a1‖ if 90° < θ ≤ 180°.
Vector projection
The vector projection of a on b is a vector a1 which is either null or parallel to b. More exactly:
- a1 = 0 if θ = 90°,
- a1 and b have the same direction if 0° ≤ θ < 90°,
- a1 and b have opposite directions if 90° < θ ≤ 180°.
Vector rejection
The vector rejection of a on b is a vector a2 which is either null or orthogonal to b. More exactly:
- a2 = 0 if θ = 0° or θ = 180°,
- a2 is orthogonal to b if 0 < θ < 180°,
Matrix representation
The orthogonal projection can be represented by a projection matrix. To project a vector onto the unit vector a = (ax, ay, az), it would need to be multiplied with this projection matrix: P a = a a T = [ a x a y a z ] [ a x a y a z ] = [ a x 2 a x a y a x a z a x a y a y 2 a y a z a x a z a y a z a z 2 ] {\displaystyle P_{\mathbf {a} }=\mathbf {a} \mathbf {a} ^{\textsf {T}}={\begin{bmatrix}a_{x}\\a_{y}\\a_{z}\end{bmatrix}}{\begin{bmatrix}a_{x}&a_{y}&a_{z}\end{bmatrix}}={\begin{bmatrix}a_{x}^{2}&a_{x}a_{y}&a_{x}a_{z}\\a_{x}a_{y}&a_{y}^{2}&a_{y}a_{z}\\a_{x}a_{z}&a_{y}a_{z}&a_{z}^{2}\\\end{bmatrix}}}
Uses
The vector projection is an important operation in the Gram–Schmidt orthonormalization of vector space bases. It is also used in the separating axis theorem to detect whether two convex shapes intersect.
Generalizations
Since the notions of vector length and angle between vectors can be generalized to any n-dimensional 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.
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, 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, and rejection of a vector from a plane.7 The projection of a vector on a plane is its 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, and rejection from a hyperplane. In geometric algebra, they can be further generalized to the notions of projection and rejection of a general multivector onto/from any invertible k-blade.
See also
External links
References
Perwass, G. (2009). Geometric Algebra With Applications in Engineering. Springer. p. 83. ISBN 9783540890676. 9783540890676 ↩
"Scalar and Vector Projections". www.ck12.org. Retrieved 2020-09-07. https://www.ck12.org/book/ck-12-college-precalculus/section/9.6/ ↩
"Scalar and Vector Projections". www.ck12.org. Retrieved 2020-09-07. https://www.ck12.org/book/ck-12-college-precalculus/section/9.6/ ↩
"Scalar and Vector Projections". www.ck12.org. Retrieved 2020-09-07. https://www.ck12.org/book/ck-12-college-precalculus/section/9.6/ ↩
"Dot Products and Projections". [dead link] http://www.math.oregonstate.edu/home/programs/undergrad/CalculusQuestStudyGuides/vcalc/dotprod/dotprod.html ↩
Hill, F. S. Jr. (1994). Graphics Gems IV. San Diego: Academic Press. pp. 138–148. ↩
M.J. Baker, 2012. Projection of a vector onto a plane. Published on www.euclideanspace.com. http://www.euclideanspace.com/maths/geometry/elements/plane/lineOnPlane/index.htm ↩