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 typescalarvector (in 3 only)
Formula𝑎𝑏=𝑎𝑖𝑏𝑖[𝑎2𝑏3𝑎3𝑏2𝑎3𝑏1𝑎1𝑏3𝑎1𝑏2𝑎2𝑏1]
Geometric formula|𝑎||𝑏|cos𝜃|𝑎||𝑏|sin𝜃𝑛̂
Geometric meaninglength of projection of 𝑎 onto 𝑏, scaled by |𝑏|vector perpendicular to both, magnitude = parallelogram area
Zero whenvectors are perpendicularvectors are parallel
Maximum whenvectors are parallelvectors are perpendicular
Commutative?yes: 𝑎𝑏=𝑏𝑎no: 𝑎×𝑏=(𝑏×𝑎)

24.2. Recovering the angle

Combining the two formulas:

cos𝜃=𝑎𝑏𝑎𝑏sin𝜃=𝑎×𝑏𝑎𝑏𝜃=arctan(𝑎×𝑏𝑎𝑏)

(This atan2-style form is numerically more stable than arccos alone, especially near 𝜃=0 or 𝜋.)

24.3. Pythagorean identity

𝑎×𝑏2+(𝑎𝑏)2=𝑎2𝑏2

(Direct from sin2+cos2=1.)

24.4. Connections