Advanced Mathematics

Dot and Cross Products

Two ways to multiply vectors: the dot product gives a number that measures alignment; the cross product gives a vector perpendicular to both.

Needs a step first: 3

a⋅b=a1b1+a2b2+a3b3=∣a∣∣b∣cos⁡θ\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3 = |\mathbf{a}||\mathbf{b}|\cos\theta, so it finds angles, tests for perpendicularity (dot product zero) and projects one vector onto another. The cross product a×b\mathbf{a} \times \mathbf{b} is perpendicular to both, with length ∣a∣∣b∣sin⁡θ|\mathbf{a}||\mathbf{b}|\sin\theta, the area of the parallelogram they span. Together they give the equations of planes, torque and magnetic force, and lead to Orthogonality and Projections and to Divergence and Curl.

Where it shows up: Attention scores in a Transformer are dot products of query and key vectors, cosine similarity compares embeddings, and the magnetic force on a moving charge is a cross product.

How to hold it: By hand, until automatic

Compute dot products and lengths instantly and read them as alignment, zero for perpendicular and a⋅b=∣a∣∣b∣cos⁡θ\mathbf{a}\cdot\mathbf{b}=|\mathbf{a}||\mathbf{b}|\cos\theta for the angle, because projections, similarity and attention all run on this.

What knowing it looks like

  • Find the angle between two vectors with the dot product, and test whether they are perpendicular.
  • Compute a cross product and check the answer is perpendicular to both vectors.
  • Find the equation of a plane through three points, using a cross product for its normal.

Test yourself

Let a=(1,2,2)\mathbf{a} = (1, 2, 2) and b=(3,0,4)\mathbf{b} = (3, 0, 4). Find the angle between them, a×b\mathbf{a} \times \mathbf{b}, and the area of the triangle with sides a\mathbf{a} and b\mathbf{b}.
Show the worked answer
a⋅b=3+0+8=11\mathbf{a} \cdot \mathbf{b} = 3 + 0 + 8 = 11, ∣a∣=3|\mathbf{a}| = 3, ∣b∣=5|\mathbf{b}| = 5, so cos⁡θ=1115\cos\theta = \frac{11}{15} and θ≈42.8∘\theta \approx 42.8^\circ. a×b=(2⋅4−2⋅0, 2⋅3−1⋅4, 1⋅0−2⋅3)=(8,2,−6)\mathbf{a} \times \mathbf{b} = (2 \cdot 4 - 2 \cdot 0,\ 2 \cdot 3 - 1 \cdot 4,\ 1 \cdot 0 - 2 \cdot 3) = (8, 2, -6); check: its dot product with a\mathbf{a} is 8+4−12=08 + 4 - 12 = 0 and with b\mathbf{b} is 24−24=024 - 24 = 0. The triangle is half the parallelogram: 1264+4+36=12104=26≈5.10\frac{1}{2}\sqrt{64 + 4 + 36} = \frac{1}{2}\sqrt{104} = \sqrt{26} \approx 5.10.

Needs a step first: 3

Learn it with an AI

Copy this prompt into any AI assistant. It will take you through step by step at your level and finish with the test above.

Be my maths tutor. I'm learning "Dot and Cross Products" (Core tier): Two ways to multiply vectors: the dot product gives a number that measures alignment; the cross product gives a vector perpendicular to both.
I already know: Vectors, Trigonometric Functions and Radians.
Teach it Socratically: first ask what I already know; then explain the core idea with one concrete example and why it's true; then give me three problems, one at a time, easy to hard. Wait for my answer, check every step, and point out mistakes without giving the answer away.
Finish by testing me with this: Let $\mathbf{a} = (1, 2, 2)$ and $\mathbf{b} = (3, 0, 4)$. Find the angle between them, $\mathbf{a} \times \mathbf{b}$, and the area of the triangle with sides $\mathbf{a}$ and $\mathbf{b}$.
Use LaTeX for formulas. When you say where it's used later (machine learning, quantum mechanics), be specific.

On the way to

Recommended