24. Dot vs Cross Product
The dot product and cross product are the two fundamental products of vectors. They give complementary geometric information.
24.1. Side-by-side
| Dot product | Cross product | |
|---|---|---|
| Result type | scalar | vector (in only) |
| Formula | ||
| Geometric formula | ||
| Geometric meaning | length of projection of onto , scaled by | vector perpendicular to both, magnitude = parallelogram area |
| Zero when | vectors are perpendicular | vectors are parallel |
| Maximum when | vectors are parallel | vectors are perpendicular |
| Commutative? | yes: | no: |
24.2. Recovering the angle
Combining the two formulas:
(This atan2-style form is numerically more stable than alone, especially near or .)
24.3. Pythagorean identity
(Direct from .)