Vector projection

The vector projection, also known as the vector component or vector resolution, of a vector a on (or onto) a non-zero vector b is the orthogonal projection of a onto a straight line parallel to b. The projection of a onto b is often written as or a∥b.

The vector component or vector resolute of a perpendicular to b, sometimes also called the vector rejection of a from b (denoted or a⊥b), is the orthogonal projection of a onto the plane (or, in general, hyperplane) that is orthogonal to b. Since both and are vectors, and their sum is equal to a, the rejection of a from b is given by:

Projection of a on b (a1), and rejection of a from b (a2)
When 90° < θ ≤ 180°, a1 has an opposite direction with respect to b.

To simplify notation, this article defines and Thus, the vector is parallel to the vector is orthogonal to and

The projection of a onto b can be decomposed into a direction and a scalar magnitude by writing it as where is a scalar, called the scalar projection of a onto b, and b̂ is the unit vector in the direction of b. The scalar projection is defined as where the operator ⋅ denotes a dot product, ‖a‖ is the length of a, and θ is the 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 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 and as: