Skip to main content

Vectors

A number like 5 5 can tell you how far you walked, but not which way. A vector fixes that: it carries both a size (magnitude) and a direction, all in one object. That single idea — packing "how much" and "which way" together — turns out to be one of the most powerful tools in all of mathematics and physics. Velocity, force, electric fields, the displacement from your house to the store, even the columns of a spreadsheet: all are vectors.

Once you can add vectors, scale them, and multiply them in the two special ways mathematicians invented (the dot product and the cross product), you hold the language that describes motion, geometry, and space itself. This page builds that language from the ground up, with worked arithmetic at every step.

Learning Objectives

  • Describe a vector by its magnitude and direction, and by its components.
  • Add and subtract vectors and multiply them by scalars, both algebraically and geometrically.
  • Compute the magnitude of a vector and find a unit vector in its direction.
  • Calculate and interpret the dot product (and the angle it reveals).
  • Calculate and interpret the cross product (and the perpendicular vector it produces).
  • Explain where vector analysis came from and why Hamilton, Grassmann, and Gibbs mattered.

Quick Answer

A vector is a quantity with both magnitude and direction, usually written in components like v=3,4\mathbf{v} = \langle 3, 4 \rangle. You add vectors component by component and scale them by multiplying every component by a number. Its magnitude is v=32+42=5\|\mathbf{v}\| = \sqrt{3^2 + 4^2} = 5. The dot product ab\mathbf{a} \cdot \mathbf{b} returns a single number that measures how much two vectors point the same way, and it equals zero exactly when they are perpendicular. The cross product a×b\mathbf{a} \times \mathbf{b} (in 3D) returns a new vector perpendicular to both, whose length equals the area of the parallelogram they span. Together these operations let you compute lengths, angles, projections, areas, and torques.

Where It Came From

For centuries, "quantity" meant a single number. But physicists studying forces and motion kept running into things that a single number could not capture: a push has a strength and a direction, and two pushes combine in a way plain addition cannot describe. The seed of the answer came from an unexpected place — complex numbers. By the early 1800s, mathematicians realized that a+bi a + bi could be pictured as a point in a plane, and that multiplying complex numbers rotated and scaled arrows in that plane. This "geometry of arrows" begged to be extended into three dimensions.

The Irish mathematician William Rowan Hamilton spent years hunting for a three-dimensional version of complex numbers. In 1843 he had his famous flash of insight while walking along the Royal Canal in Dublin: you need four dimensions, not three. His quaternions (a+bi+cj+dk a + bi + cj + dk) worked, and buried inside them were the operations we now call the dot and cross products. Around the same time, the German schoolteacher Hermann Grassmann published his Ausdehnungslehre (1844), a strikingly abstract theory of "extended quantities" that anticipated modern linear algebra — but it was so far ahead of its time that almost no one read it.

Quaternions were powerful but awkward for everyday physics. In the 1880s, the American physicist Josiah Willard Gibbs and, independently, the English engineer Oliver Heaviside stripped away the quaternion machinery and kept the useful part: a clean vector algebra with separate dot and cross products. Gibbs's lecture notes at Yale spread this streamlined system, and it is essentially the vector notation every student learns today. The concept was born from a genuine need — to do arithmetic with directed quantities — and refined by trimming a brilliant but unwieldy invention down to what physics actually required.

Vectors, Components, and Magnitude

A vector is often drawn as an arrow: its length is the magnitude, and the way it points is the direction. Two arrows are the same vector if they have the same length and direction, even if they start at different places — a vector has no fixed home.

To do arithmetic, we describe a vector by its components: how far it reaches along each axis. In the plane,

v=vx,vy \mathbf{v} = \langle v_x, v_y \rangle

means "vxv_x units right, vyv_y units up." In three dimensions we add a third component vzv_z.

The magnitude (length) comes straight from the Pythagorean theorem:

v=vx2+vy2+vz2. \|\mathbf{v}\| = \sqrt{v_x^2 + v_y^2 + v_z^2}.

Worked example. Let v=6,8\mathbf{v} = \langle 6, -8 \rangle. Then

v=62+(8)2=36+64=100=10. \|\mathbf{v}\| = \sqrt{6^2 + (-8)^2} = \sqrt{36 + 64} = \sqrt{100} = 10.

A unit vector points the same way but has length 1 1; you get it by dividing by the magnitude:

v^=1106,8=0.6, 0.8. \hat{\mathbf{v}} = \frac{1}{10}\langle 6, -8 \rangle = \left\langle 0.6,\ -0.8 \right\rangle.

Check: 0.62+(0.8)2=0.36+0.64=1=1\sqrt{0.6^2 + (-0.8)^2} = \sqrt{0.36 + 0.64} = \sqrt{1} = 1. Good.

Addition, Subtraction, and Scalar Multiplication

Adding vectors combines their effects. Algebraically, add matching components:

a1,a2+b1,b2=a1+b1, a2+b2. \langle a_1, a_2 \rangle + \langle b_1, b_2 \rangle = \langle a_1 + b_1,\ a_2 + b_2 \rangle.

Geometrically this is the tip-to-tail rule: place the tail of b\mathbf{b} at the tip of a\mathbf{a}; the sum runs from the start of a\mathbf{a} to the end of b\mathbf{b}. It is also the diagonal of the parallelogram they form.

Scalar multiplication stretches or shrinks a vector (and flips it if the scalar is negative):

ca1,a2=ca1, ca2. c\,\langle a_1, a_2 \rangle = \langle c\,a_1,\ c\,a_2 \rangle.

Worked example. Let a=3,1\mathbf{a} = \langle 3, 1 \rangle and b=1,4\mathbf{b} = \langle -1, 4 \rangle. Compute 2ab 2\mathbf{a} - \mathbf{b}.

2a=6,2,2ab=6(1), 24=7,2. 2\mathbf{a} = \langle 6, 2 \rangle, \qquad 2\mathbf{a} - \mathbf{b} = \langle 6 - (-1),\ 2 - 4 \rangle = \langle 7, -2 \rangle.

Subtraction ab\mathbf{a} - \mathbf{b} is just a+(1)b\mathbf{a} + (-1)\mathbf{b}, and geometrically it is the arrow from the tip of b\mathbf{b} to the tip of a\mathbf{a} — the reason ab\mathbf{a} - \mathbf{b} gives the displacement between two points.

The Dot Product: Measuring Alignment

The dot product takes two vectors and returns a single number (a scalar). Two equivalent formulas make it useful:

ab=a1b1+a2b2+a3b3=abcosθ, \mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3 = \|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta,

where θ\theta is the angle between the vectors. The second form is the key to its meaning: the dot product measures how much two vectors point the same way. It is positive when the angle is acute, zero when they are perpendicular (cos90=0\cos 90^\circ = 0), and negative when the angle is obtuse.

Worked example — finding an angle. Let a=3,4\mathbf{a} = \langle 3, 4 \rangle and b=4,3\mathbf{b} = \langle 4, 3 \rangle.

Component form: ab=(3)(4)+(4)(3)=12+12=24.\mathbf{a} \cdot \mathbf{b} = (3)(4) + (4)(3) = 12 + 12 = 24.

Magnitudes: a=b=32+42=5.\|\mathbf{a}\| = \|\mathbf{b}\| = \sqrt{3^2 + 4^2} = 5.

So

cosθ=245×5=2425=0.96    θ16.3. \cos\theta = \frac{24}{5 \times 5} = \frac{24}{25} = 0.96 \implies \theta \approx 16.3^\circ.

Perpendicularity test. If ab=0\mathbf{a} \cdot \mathbf{b} = 0, the vectors are perpendicular. For example 2,33,2=66=0\langle 2, 3 \rangle \cdot \langle 3, -2 \rangle = 6 - 6 = 0, so those two are at right angles.

The dot product also gives the projection of one vector onto another — the "shadow" of a\mathbf{a} along b\mathbf{b} has length abb\dfrac{\mathbf{a}\cdot\mathbf{b}}{\|\mathbf{b}\|} — which is exactly how physics computes the work done by a force: W=FdW = \mathbf{F} \cdot \mathbf{d}.

The Cross Product: Building a Perpendicular

The cross product exists in three dimensions and returns a new vector, not a number. That result a×b\mathbf{a} \times \mathbf{b} is perpendicular to both inputs, its direction is given by the right-hand rule, and its magnitude equals the area of the parallelogram spanned by a\mathbf{a} and b\mathbf{b}:

a×b=absinθ. \|\mathbf{a} \times \mathbf{b}\| = \|\mathbf{a}\|\,\|\mathbf{b}\|\sin\theta.

In components,

a×b=a2b3a3b2,  a3b1a1b3,  a1b2a2b1. \mathbf{a} \times \mathbf{b} = \langle a_2 b_3 - a_3 b_2,\ \ a_3 b_1 - a_1 b_3,\ \ a_1 b_2 - a_2 b_1 \rangle.

Worked example. Let a=1,0,0\mathbf{a} = \langle 1, 0, 0 \rangle and b=0,1,0\mathbf{b} = \langle 0, 1, 0 \rangle (the xx- and yy-axis directions).

a×b=(0)(0)(0)(1),  (0)(0)(1)(0),  (1)(1)(0)(0)=0,0,1. \mathbf{a} \times \mathbf{b} = \langle (0)(0) - (0)(1),\ \ (0)(0) - (1)(0),\ \ (1)(1) - (0)(0) \rangle = \langle 0, 0, 1 \rangle.

The result points straight up the zz-axis — perpendicular to both, exactly as the right-hand rule predicts, with length 1 1 (the area of the unit square).

A less trivial example. Let a=2,3,4\mathbf{a} = \langle 2, 3, 4 \rangle, b=5,6,7\mathbf{b} = \langle 5, 6, 7 \rangle.

  • First component: (3)(7)(4)(6)=2124=3.(3)(7) - (4)(6) = 21 - 24 = -3.
  • Second component: (4)(5)(2)(7)=2014=6.(4)(5) - (2)(7) = 20 - 14 = 6.
  • Third component: (2)(6)(3)(5)=1215=3.(2)(6) - (3)(5) = 12 - 15 = -3.

So a×b=3,6,3\mathbf{a} \times \mathbf{b} = \langle -3, 6, -3 \rangle. You can verify perpendicularity: a(a×b)=(2)(3)+(3)(6)+(4)(3)=6+1812=0.\mathbf{a} \cdot (\mathbf{a}\times\mathbf{b}) = (2)(-3)+(3)(6)+(4)(-3) = -6+18-12 = 0. Perfect.

Note the cross product is anticommutative: b×a=(a×b)\mathbf{b} \times \mathbf{a} = -(\mathbf{a} \times \mathbf{b}), which is why the order (and the hand you use) matters.

Real-World Applications

  • Physics and engineering. Forces, velocities, and accelerations are vectors; adding them gives net effects. Torque is a cross product (τ=r×F\boldsymbol{\tau} = \mathbf{r} \times \mathbf{F}), and work is a dot product.
  • Computer graphics and games. Surface normals (via cross products) decide how light reflects; dot products determine whether a surface faces the camera and how bright it appears.
  • Navigation and robotics. Displacement, heading, and wind or current corrections are vector additions; GPS and drone flight controllers rely on them constantly.
  • Machine learning. Data points are vectors; the dot product measures similarity (cosine similarity), the backbone of search and recommendation systems.
  • Electromagnetism. Electric and magnetic fields are vector fields; the magnetic force F=qv×B\mathbf{F} = q\,\mathbf{v} \times \mathbf{B} is a cross product.

Common Mistakes

  1. Confusing the dot product with the cross product. The dot product returns a number; the cross product returns a vector. Writing "ab=\mathbf{a} \cdot \mathbf{b} = \langle \dots \rangle" is a category error. Fix: ask what you want — a measure of alignment (dot) or a perpendicular direction/area (cross)?

  2. Thinking you add magnitudes. Students often assume a+b=a+b\|\mathbf{a} + \mathbf{b}\| = \|\mathbf{a}\| + \|\mathbf{b}\|. This is only true when the vectors point the same way. For 3,0+0,4=3,4\langle 3,0 \rangle + \langle 0,4 \rangle = \langle 3,4 \rangle, the magnitude is 5 5, not 3+4=7 3 + 4 = 7. Fix: add components first, then take the magnitude.

  3. Forgetting that the cross product needs 3D and cares about order. There is no true cross product of two plane vectors, and a×bb×a\mathbf{a} \times \mathbf{b} \neq \mathbf{b} \times \mathbf{a} — they are negatives. Fix: work in three components (pad 2D vectors with a 0 0 zz-component) and keep the order straight.

Comparison and Connections

The dot and cross products answer different questions about the same pair of vectors:

FeatureDot product ab\mathbf{a}\cdot\mathbf{b}Cross product a×b\mathbf{a}\times\mathbf{b}
OutputScalar (number)Vector
Formula (geometric)abcosθ\Vert \mathbf{a}\Vert \Vert \mathbf{b}\Vert \cos\thetaabsinθ\Vert \mathbf{a}\Vert \Vert \mathbf{b}\Vert \sin\theta (magnitude)
Zero whenVectors are perpendicularVectors are parallel
DimensionsAnyOnly 3D
Order matters?No (commutative)Yes (anticommutative)
MeasuresAlignment / projectionPerpendicular direction / area

A vector differs from a scalar (a plain number with no direction) and from a point (a fixed location). A vector is really the displacement between two points. Vectors are also the building blocks of the broader idea of a vector space, where the same addition and scaling rules apply to functions, polynomials, and more.

Practice Questions

Recall

State the two formulas for the dot product and what each is best used for.

Answer: ab=a1b1+a2b2+a3b3\mathbf{a}\cdot\mathbf{b} = a_1b_1 + a_2b_2 + a_3b_3 (best for computing from components) and ab=abcosθ\mathbf{a}\cdot\mathbf{b} = \|\mathbf{a}\|\|\mathbf{b}\|\cos\theta (best for finding the angle).

Understanding

Why does a zero cross product mean two vectors are parallel?

Answer: Because a×b=absinθ\|\mathbf{a}\times\mathbf{b}\| = \|\mathbf{a}\|\|\mathbf{b}\|\sin\theta, and sinθ=0\sin\theta = 0 exactly when θ=0\theta = 0^\circ or 180 180^\circ — that is, when the vectors point the same or opposite way. The parallelogram they span has zero area.

Application

A boat heads due east at 8 8 km/h while a current pushes it due north at 6 6 km/h. Find its resulting speed and describe its direction.

Answer: Resultant =8,6= \langle 8, 6 \rangle, so speed =82+62=100=10= \sqrt{8^2 + 6^2} = \sqrt{100} = 10 km/h, heading arctan(6/8)36.9\arctan(6/8) \approx 36.9^\circ north of east.

Analysis

Given a=1,2,2\mathbf{a} = \langle 1, 2, 2 \rangle and b=2,0,1\mathbf{b} = \langle 2, 0, -1 \rangle, determine whether they are perpendicular, and find a\|\mathbf{a}\|.

Answer: ab=(1)(2)+(2)(0)+(2)(1)=2+02=0\mathbf{a}\cdot\mathbf{b} = (1)(2)+(2)(0)+(2)(-1) = 2 + 0 - 2 = 0, so yes, perpendicular. a=1+4+4=9=3\|\mathbf{a}\| = \sqrt{1 + 4 + 4} = \sqrt{9} = 3.

FAQ

Is a vector the same as a coordinate/point? Closely related but not identical. A point is a location; a vector is a displacement (an arrow) that can be moved around freely. The vector 3,4\langle 3, 4 \rangle describes "3 right, 4 up" from anywhere, while the point (3,4)(3,4) is one specific spot.

Why do we need two different products? Because there are two natural geometric questions: "how aligned are these vectors?" (dot) and "what direction is perpendicular to both, and how big is the region they span?" (cross). No single operation answers both.

Can I take the cross product of two 2D vectors? Not as a full vector — the cross product lives in 3D. But you can treat 2D vectors as having a 0 0 zz-component; the result then points along the zz-axis, and its (signed) length a1b2a2b1 a_1 b_2 - a_2 b_1 is a handy 2D "cross" that gives area and orientation.

What does a negative dot product mean? The angle between the vectors is obtuse (greater than 90 90^\circ) — they point in generally opposite directions. In a work calculation, negative work means the force opposes the motion.

How is this connected to matrices and linear algebra? Vectors are the objects that matrices act on. A matrix transforms vectors (rotating, scaling, shearing them), and the columns of a matrix are themselves vectors. Understanding vectors first makes matrices far more intuitive.

Quick Revision

  • A vector has magnitude and direction; write it in components vx,vy,vz\langle v_x, v_y, v_z \rangle.
  • Magnitude: v=vx2+vy2+vz2\|\mathbf{v}\| = \sqrt{v_x^2 + v_y^2 + v_z^2}; unit vector: divide by the magnitude.
  • Add/subtract component-wise; scale by multiplying each component.
  • Dot product: ab=a1b1+a2b2+a3b3=abcosθ\mathbf{a}\cdot\mathbf{b} = a_1b_1 + a_2b_2 + a_3b_3 = \|\mathbf{a}\|\|\mathbf{b}\|\cos\theta; =0 = 0 means perpendicular.
  • Cross product (3D): returns a vector perpendicular to both; magnitude absinθ\|\mathbf{a}\|\|\mathbf{b}\|\sin\theta = parallelogram area; anticommutative.
  • History: Hamilton (quaternions, 1843), Grassmann (1844), Gibbs and Heaviside (modern vector algebra, 1880s).

Prerequisites

  • Matrices and linear transformations
  • Coordinate geometry and the Pythagorean theorem

Next Topics

  • Vector spaces, bases, and dimension
  • Systems of linear equations and matrix operations