High SchoolCoreMathPhysicsVectorsTrigonometry

Vectors: components, addition, dot and cross products

A vector has magnitude and direction. Split it into components and addition, scaling, dot and cross products all become simple arithmetic.

What is a vector?

Imagine you are giving someone directions. If you say 'walk 5 kilometres', they don't know where to go. If you say 'walk north', they don't know how far. A vector is a mathematical object that combines both: it has a magnitude (a length) and a direction (an angle). Force, velocity, acceleration and displacement are all vectors.

Key fact
A vector has size and direction. The trick to working with one is to split it into perpendicular components — then every operation becomes ordinary arithmetic on numbers.

The three pillars of a vector

  • Magnitude: The scalar size of the vector (e.g., speed, force intensity).
  • Direction: The line along which the vector points (the angle).
  • Orientation (Sense): Which way the arrow points along that line.
Wait, what is a Scalar?
A scalar is just a number (like temperature or mass). It has no direction. Vectors are 'scalars with an attitude'—they point somewhere!

Breaking a vector into components

Computers and engineers don't usually work with 'angles' directly; they break vectors down into Components. By placing a vector on a Cartesian Plane, we can find its influence along the X and Y axes using Trigonometry.

vx=∣v∣⋅cos⁡(θ),vy=∣v∣⋅sin⁡(θ)v_x = |v| \cdot \cos(\theta) \quad , \quad v_y = |v| \cdot \sin(\theta)

Conversely, if we have the components, we use the Pythagorean Theorem to find the total magnitude and the Arctangent for the angle.

∣v∣=vx2+vy2,θ=arctan⁡(vyvx)|v| = \sqrt{v_x^2 + v_y^2} \quad , \quad \theta = \arctan\left(\frac{v_y}{v_x}\right)
Magnitude of a vector · formula card →

Adding and subtracting vectors

Adding vectors is not as simple as 2+2=42 + 2 = 4. If you walk 3m East and 4m North, you are 5m away from the start, not 7m. This is Vector Addition.

Visual Methods

  • Tip-to-Tail Method: Place the start of the second vector at the end of the first. The result is the line from the very start to the very end.
  • Parallelogram Method: Start both vectors from the same origin. Create a parallelogram; the diagonal is the resultant.
Common Pitfall: Subtraction
Vector subtraction a⃗−b⃗\vec{a} - \vec{b} is actually the addition of the opposite: a⃗+(−b⃗)\vec{a} + (-\vec{b}). Graphically, the result points from the tip of B to the tip of A.
The Resultant Force
If two people pull a box in different directions, the box moves along the 'Resultant' vector created by adding their individual force vectors.

Scaling and normalising

Multiplication by a Scalar changes the length of a vector without changing its direction (unless the scalar is negative, which flips the direction 180°).

Normalization (Unit Vectors)

In game development and physics, we often only care about the direction. A Unit Vector is a vector with a magnitude of exactly 1. We create it through Normalization.

v^=v⃗∣v∣\hat{v} = \frac{\vec{v}}{|v|}
Use Case: Character Movement
If a player holds 'Up' and 'Right', the combined vector is longer than 1. If you don't normalize it, the character will move faster diagonally than they do straight! Always normalize your input vectors.

The dot product: measuring alignment

The Dot Product is one of the most powerful tools in physics. It takes two vectors and returns a single Scalar number. It measures how much one vector 'points' in the same direction as another.

a⃗⋅b⃗=∣a∣∣b∣cos⁡(θ)=axbx+ayby\vec{a} \cdot \vec{b} = |a||b| \cos(\theta) = a_x b_x + a_y b_y
Dot product · formula card →
Angle (θ)Dot Product ResultMeaning
0°Positive (Max)Vectors point in the same direction.
90°ZeroVectors are Orthogonal (Perpendicular).
180°Negative (Min)Vectors point in opposite directions.
Physical Work
In physics, Work is defined as W=F⃗⋅d⃗W = \vec{F} \cdot \vec{d}. If you push a wall, you apply force, but displacement is zero, so Work is zero!

The cross product: area and torque

Unlike the Dot Product, the Cross Product returns a Vector. In 3D, this vector is perpendicular to both inputs. In 2D, we calculate a 'Pseudoscalar' which represents the area of the parallelogram formed by the vectors.

a⃗×b⃗=∣a∣∣b∣sin⁡(θ)n^\vec{a} \times \vec{b} = |a||b| \sin(\theta) \hat{n}

This is crucial for calculating torque (rotational force) and for determining whether a point lies to the left or the right of a line — the sign of the 2D cross product tells you which side.

Frequently asked questions

What is the difference between a vector and a scalar?

A scalar is a single number — mass, temperature, speed. A vector has both a magnitude and a direction — velocity, force, displacement. You can add two scalars with ordinary arithmetic; adding two vectors means combining their directions too.

Why isn't the magnitude of a sum equal to the sum of the magnitudes?

Because the vectors point in different directions, so they partly work against each other. Walk 3 m east then 4 m north and you end up 5 m from the start, not 7 m — the components add, and Pythagoras gives the resulting length.

What does the dot product actually tell you?

How much two vectors point the same way. It is ∣a∣∣b∣cos⁡θ|a||b|\cos\theta: positive when the angle between them is under 90°, zero when they are perpendicular, negative when they oppose. In physics, work is the dot product of force and displacement.

When do I need to normalise a vector?

Whenever you only care about direction, not size — for example, to get a unit "which way" vector for steering or for projecting one vector onto another. Divide the vector by its own magnitude and its length becomes exactly 1.

Keep exploring