Learn Vectors: dot & cross product from scratch
1What a vector is
Some quantities only need a number: a mass of 5 kg or a temperature of 20 °C. These are scalars.
Other quantities also need a direction. A force of 40 N pushing up is very different from 40 N pushing sideways. These are vectors.
You describe a vector by its components: how far it reaches along x, along y and along z. The vector a = (4, 3, 0) reaches 4 units along x, 3 along y and 0 along z.
Forces, displacements and velocities are all vectors. Engineers use vector maths to add forces, find angles and calculate moments in three dimensions.
Vectors add component by component: (1, 2, 0) + (3, −1, 4) = (4, 1, 4). This is how you find the resultant of several forces.
Self-check What is the length of the vector a = (3, 4, 0)?
- 1
- 25
- 5
- 7
Answer: 5. The length is √(3² + 4² + 0²) = √25 = 5. Adding the components (7) is wrong because they are perpendicular, and 25 forgets the square root.
2Length, direction and components
The magnitude |a| is the length of the vector. It is Pythagoras in three dimensions:
|a| = √(ax² + ay² + az²)
A unit vector has length 1 and points in the same direction. You get it by dividing every component by the magnitude:
û = a / |a|
For a = (0, 3, 4) the magnitude is 5, so û = (0, 0.6, 0.8). Check: 0.6² + 0.8² = 1.
A force in the xy-plane is often given as a size F and an angle θ, measured anticlockwise from the positive x-axis. Its components are:
Fx = F·cos θ Fy = F·sin θ
The cosine and sine give the signs automatically. A force at 120° has a negative x-component because cos 120° = −0.5.
Going back from components to an angle, arctan(Ry/Rx) only gives answers between −90° and 90°. If Rx is negative, add 180°. If only Ry is negative, add 360°.
Self-check What is the y-component of the unit vector in the direction of a = (0, 3, 4)?
- 0.12
- 0.43
- 0.6
- 3
Answer: 0.6. Divide by the magnitude 5: 3/5 = 0.6. 3 forgets to divide, 0.12 divides by |a|² = 25, and 0.43 divides by the sum of the components (7).
3The dot product and the cross product
There are two ways to multiply two vectors. The dot product gives a number. The cross product gives a new vector.
a·b = axbx + ayby + azbz = |a|·|b|·cos θ
Here θ is the angle between the two vectors. The dot product measures how much the vectors point the same way. It is zero when they are perpendicular.
- The angle: cos θ = a·b / (|a|·|b|).
- The scalar projection of a onto b (the part of a along b): a·b / |b|.
- The work done by a constant force over a displacement: W = F·d.
- Two vectors are perpendicular when a·b = 0.
The cross product a × b is a vector perpendicular to both a and b. Its length equals the area of the parallelogram the two vectors span.
a × b = (aybz − azby, azbx − axbz, axby − aybx)
For a = (1, 2, 0) and b = (3, 1, 0): a × b = (2·0 − 0·1, 0·3 − 1·0, 1·1 − 2·3) = (0, 0, −5). The parallelogram has area 5 and the triangle half of that, 2.5.
Order matters: b × a = −(a × b). The moment of a force F acting at point A about point O is M = r × F, with r = A − O.
Self-check For a = (2, 1, 0) and b = (1, 4, 0), what is the z-component of a × b?
- 6
- 7
- 9
- −7
Answer: 7. z-component = axby − aybx = 2·4 − 1·1 = 7. −7 is b × a (the order swapped), 6 is the dot product, and 9 adds the two products instead of subtracting.
4The method step by step
- Write every vector in components. For a force given by size and angle, use F·cos θ and F·sin θ.
- If the question gives points, build the vectors from them: the vector from A to B is B − A.
- Decide which tool you need. Lengths and directions: magnitude and unit vector. Angles, projections and work: dot product. Areas, perpendicular vectors and moments: cross product.
- Write the formula first, then put in the numbers one component at a time. Keep the signs in brackets.
- Check the result: a unit vector has length 1, a × b is perpendicular to a (so a·(a × b) = 0), and an angle between vectors lies between 0° and 180°.
For a unit vector perpendicular to two vectors, take n = a × b and divide it by its length. If the question wants a positive z-component and yours is negative, flip all the signs.
The volume of the box (parallelepiped) with edges a, b and c is |a·(b × c)|: first the cross product, then the dot product.
5A worked example
Follow every step. Try to predict the next one before you open it.
Worked exampleA constant force F = (6, 2, −3) N pushes an object in a straight line from point A(1, 0, 2) to point B(3, 4, 2). Coordinates are in metres. Find the work W done by the force and the angle θ between the force and the displacement.
1The displacement is the vector from A to B: subtract the start from the end.
d = B − A = (3 − 1, 4 − 0, 2 − 2) = (2, 4, 0) m
2Work is the dot product of force and displacement. Multiply matching components and add.
W = F·d = 6·2 + 2·4 + (−3)·0 = 12 + 8 + 0 = 20 J
3|F| = √(6² + 2² + (−3)²) = √49 = 7 N
|d| = √(2² + 4² + 0²) = √20 ≈ 4.472 m
4Use the other form of the dot product, F·d = |F|·|d|·cos θ, and solve for cos θ.
cos θ = 20 / (7 · 4.472) = 0.6389
θ = arccos 0.6389 ≈ 50.3°
5The work is positive, so the angle must be less than 90°. It is.
The part of the force along the motion is |F|·cos θ = 7 · 0.6389 ≈ 4.47 N. Times the distance 4.472 m this gives 20 J again.
Answer W = 20 J and θ ≈ 50.3°.
6Common mistakes
- Adding magnitudes instead of components. Two forces of 3 N and 4 N at right angles give 5 N, not 7 N.
- Using the coordinates of the point instead of r = A − O in a moment.
- Getting the sign of the middle (y) component of a cross product wrong. It is azbx − axbz, not the other way round.
- Swapping the order in a cross product. b × a points the opposite way to a × b.
- Taking arctan for a direction without checking which quadrant the vector is in.
- Forgetting the ½ for the area of a triangle: it is half of |AB × AC|.
Self-check A force F = (0, 10, 0) N acts at point A(3, 0, 0) m. What is the size of its moment about O(1, 0, 0) m?
- 10 N·m
- 20 N·m
- 30 N·m
- 40 N·m
Answer: 20 N·m. r = A − O = (2, 0, 0) m, so M = r × F = (0, 0, 2·10) = (0, 0, 20) N·m. Using the point A itself as r gives 30 N·m, A + O gives 40 N·m, and O alone gives 10 N·m.
7How exam questions look
- Easy: magnitude and components. The length of a vector, one component of a unit vector, a component of a force given by size and angle, or the size or direction of the resultant of two forces.
- Medium: the dot product. A dot product, the angle between two vectors, a scalar projection, the work done by a force between two points, or the value of k that makes two vectors perpendicular.
- Hard: the cross product and moments. One component of a × b, the area of a parallelogram or triangle, the moment of a force about a point, a unit normal vector, or the volume of a box from a triple product.
For a perpendicularity question, set a·b = 0. It gives one linear equation in k.
For a triangle with corners A, B and C, use the edge vectors AB = B − A and AC = C − A. The area is ½·|AB × AC|.
Learn it step by step in the appLearn it step by step in the app