This was developed as an aid to understanding the dot product function used in Fractal Kitty's There is(Ǝ) – Such that (∋) project.
The dot product is the length of vector A projected on vector B (you can imagine this as the length of the shadow that A would cast on B, if a flashlight were shining perpendicularly at B), times the length of vector B. If the two vectors point in directions 90° apart, the dot product is 0 since neither has a component in the other's direction. If they point in the same exact direction, it is just the full length of A times the full length of B.
Mathematically, the dot product of vectors A and B defined as |A| * |B| * Cos θ, where |A| and |B| are the lengths of vectors A and B, and θ is the angle between them.
Dot Product Visualizer
Dot product definition:
A · B =|B| * |signed projection of A onto B|
or
|A| * |signed projection of B onto A|
(|A| means "the length of vector A")
Both definitions are always equal for ordinary Euclidean vectors, because the length of the signed projection of A onto B calculated by:
|A| * cos(θ)
where θ is the angle between vectors A & B.
So,
A · B = |B| * |signed projection of A onto B| = |B| * |A| * cos(θ)
and
B · A = |A| * |signed projection of B onto A| = |A| * |B| * cos(θ)
...which is the same thing. You can click the "Swap A and B" button above to see how this works in practice.
