Vector Operations
The first main vector operation is known as the dot product, which measures how parallel two vectors are to each other. It measures how much each vector’s direction goes in the other vector’s direction. Technically, the definition of a dot product is whether or not vector2 pushes with or against vector1.
For example, if two vectors with the same magnitude (or size) were parallel, they would have a dot product of 1, which is the highest value this dot product could produce. Two perpendicular vectors would have a dot product of 0, and two vectors in opposite directions would have a value of -1.
To calculate a dot product mathematically, you separate the dimensions of each vector, multiply like terms, and then add everything together. Here, I made a sample calculation with two vectors V and W.
If V.W (notation for the dot product) is positive, the two vectors are relatively in the same direction. If V.W is negative, then they point in relatively opposite directions.
Geometrically, you can also determine the dot product with this formula using the magnitudes of V and W as well as Θ, which is the angle between the two vectors.
V.W = |V| |W| Cos(Θ)
Projection
Something that is defined as scalar means that it only has magnitude and no direction. The value only has a size, without it being related to its direction. Some examples of scalar quantities are speed, time, and the projection vector. The projection vector of one vector over another vector is the length of the shadow of the given vector over another vector, which looks like this:
where the blue vector is the projection of X onto Y.
The mathematical formula for the projection of X onto Y is as follows:
Vector projection is used in many Free Body Diagrams, which show forces acting on an object. Projection is especially useful when dealing with inclined planes, to get force vectors on the same 2D axes, so we can work with them mathematically.