Scalar projection
In mathematics, the scalar projection of a vector  on (or onto) a vector  also known as the scalar resolute of  in the direction of  is given by:

where the operator  denotes a dot product,  is the unit vector in the direction of   is the length of  and  is the angle between  and . The term scalar component refers sometimes to scalar projection, as, in Cartesian coordinates, the components of a vector are the scalar projections in the directions of the coordinate axes. The scalar projection is a scalar, equal to the length of the orthogonal projection of  on , with a negative sign if the projection has an opposite direction with respect to . Multiplying the scalar projection of  on  by  converts it into the above-mentioned orthogonal projection, also called vector projection of  on . Definition based on angle θ
If the angle  between  and  is known, the scalar projection of  on  can be computed using

   ( in the figure)

The formula above can be inverted to obtain the angle, θ. Definition in terms of a and b
When  is not known, the cosine of  can be computed in terms of  and  by the following property of the dot product :
 

By this property, the definition of the scalar projection  becomes:

Properties
The scalar projection has a negative sign if . It coincides with the length of the corresponding vector projection if the angle is smaller than 90°. More exactly, if the vector projection is denoted  and its length :

  if 
  if

See also
 Scalar product
 Cross product
 Vector projection

Sources
Dot products - www.mit.org
Scalar projection - Flexbooks.ck12.org
Scalar Projection & Vector Projection - medium.com
Lesson Explainer: Scalar Projection | Nagwa
Operations on vectors