Introducing the dot product, what it essentially does is it takes a vector(the red line), and projects it onto another vector(the green line), resulting in the yellow line. In most use cases, the green line is a normal vector or a unit vector(meaning it has a magnitude of 1). ------------------------------------------------------------ Hold Left Mouse Button to move the red line ------------------------------------------------------------ I used the power of Dot products to make this physics simulation below: https://scratch.mit.edu/projects/1352381360/
In case you didn't notice, if the 2 vectors are perpendicular(they make an angle of 90 degrees), the dot product is 0, if the red line is more or less looking in the same direction as green, it is positive, if the red line is more or less looking in the opposite direction of the red line, the dot product is negative.