Section 4 of 5
The dot product
The dot product multiplies two vectors and produces a number. Multiply matching components and add:
For example, .
What it means
The same number can be computed from the lengths and the angle between the vectors:
So the dot product measures how much two vectors point the same way:
- positive when
- zero when they are perpendicular,
- negative when
Projection
The dashed line drops straight onto the line of , like a shadow cast by a light shining directly above it. The highlighted segment is the projection of onto , and
Drag the vectors and watch the shadow shrink to nothing as reaches , then flip to the other side.
The dot product shows up everywhere: in physics, the work done by a force is . In graphics, it decides how brightly light hits a surface.
Compute .