Vectors in 2D and 3D — Dot and Cross Products
Vectors are quantities with both magnitude and direction. The dot product yields a scalar measuring alignment; the cross product (3D only) yields a vector perpendicular to both with magnitude . Used everywhere in geometry, physics, engineering, and computer graphics. The dot product dates to Hamilton/Grassmann (1840s), formalised by Gibbs and Heaviside (1880s).A vector is an object characterised by a magnitude (length) and a direction, contrasted with a scalar, which has magnitude only. In two and three dimensions, vectors can be written in component form and combined through addition, scalar multiplication, and two distinct products. The dot (scalar) product combines two vectors into a number that encodes how parallel they are; the cross (vector) product, defined only in 3D, combines two vectors into a third vector perpendicular to the plane they span. These two products turn raw geometry into algebra, making it possible to compute angles, areas, volumes, projections, torques, and work with a few short formulas. A surprising fact: the dot product is the only bilinear way (up to scaling) to recover the familiar Euclidean angle, while the cross product is a near-miracle that exists in exactly 3 (and 7) dimensions and nowhere else.
The Core Insight
Two vectors carry two independent pieces of relational information: how much they point the same way (captured by the dot product, a scalar involving ) and how much they sweep out area between them (captured by the cross product, whose magnitude involves ). Together and fully determine the geometric relationship between two directions, so these two products let you answer essentially any metric question about vectors algebraically.
Formal Statement
Vector in component form
A vector in 2D is an ordered pair, and in 3D an ordered triple, of real numbers (its components):
Here are real scalars. The standard basis vectors are , , , so .
The magnitude (length, norm) is
Dot product
For vectors and , the dot product is defined componentwise and equivalently geometrically:
where is the angle between the two vectors. The result is a scalar. (For 2D, drop the third term.)
Cross product
For 3D vectors, the cross product is the vector
with magnitude and direction
The direction of is perpendicular to both and , given by the right-hand rule.
Key algebraic properties
The dot product is commutative and distributive:
The cross product is anticommutative and not associative:
Why It Holds / Derivation
Geometric form of the dot product
We show the componentwise formula [3] equals .
Step 1. Place and tail-to-tail. The vector closes the triangle, opposite the angle between them. Step 2. By the Law of Cosines,Josiah Willard Gibbs | 1839–1903
The American physicist and chemist Gibbs, while teaching at Yale, distilled Hamilton's cumbersome quaternion algebra into the clean dot- and cross-product notation used today. His privately printed lecture notes Elements of Vector Analysis (1881–84) — together with parallel work by the British engineer Oliver Heaviside — replaced quaternions with the two-product vector calculus that became the universal language of physics. Gibbs is also a founder of chemical thermodynamics and statistical mechanics.
Building Intuition
Think of the dot product as asking: "How much of goes in the direction of ?" If they point the same way, and the product is large and positive. Perpendicular vectors share no direction, so and the dot product vanishes — this is the algebraic test for being at right angles. Opposing vectors give a negative dot product.
The cross product answers a different question: "What is the area of the parallelogram these two vectors span, and which way is its surface facing?" The magnitude is exactly that parallelogram's area, vanishing when the vectors are parallel (zero area). The direction sticks straight out of the plane — curl the fingers of your right hand from toward , and your thumb points along .
Dot and cross product geometry: projection (left) and parallelogram area (right)
Worked Examples
Dot product: angle and work
Given: and . Find the angle between them. Then, treating as a force in newtons and as a displacement in metres, find the work done. Step 1 — magnitudes: , . Step 2 — dot product (componentwise): . Step 3 — angle: , so . Step 4 — work: .Cross product: area and perpendicular
Given: Triangle with vertices , , . Find the triangle's area and a vector normal to its plane. Step 1 — edge vectors: , . Step 2 — cross product (formula [4]):Common Misconceptions
The cross product does not exist in 2D. Equation [4] requires three components. For 2D vectors, the closest analogue is the scalar — the -component you'd get by embedding the vectors in 3D. Treat this as a signed area, not a vector. Do not confuse the two products. is a scalar; is a vector. Writing "" where a direction is needed (or vice versa) is a type error. The cross product is not associative. In general . Use the BAC–CAB identity when expanding triple products.A student claims " means or ," by analogy with real-number multiplication. Counterexample: , gives though neither vector is zero. The dot product can vanish for nonzero vectors — precisely when they are perpendicular. Likewise does not force either factor to vanish; it happens whenever the vectors are parallel.
Connections
The dot product is the prototype of an inner product, generalising to function spaces and underpinning Orthogonality and Fourier Series. The expression links it to the Pythagorean Theorem and the Euclidean metric. The cross product determinant in [4] connects directly to Determinants and the Scalar Triple Product, which computes volumes. Both products are bilinear, foreshadowing Linear Transformations and Matrix Multiplication. In physics, the dot product defines Work and Energy while the cross product defines Torque and Angular Momentum.
Real-World Applications
- Physics — work and power: Work uses the dot product to count only the component of force along the displacement.
- Physics — torque: Torque uses the cross product; its direction is the axis of rotation (right-hand rule).
- Electromagnetism — Lorentz force: A charged particle feels , perpendicular to both velocity and magnetic field — the basis of cyclotrons and electric motors.
- Computer graphics — lighting: Surface brightness uses (Lambert's cosine law); surface normals for shading are computed as cross products of triangle edges.
- Computer graphics — back-face culling: The sign of a cross product tells whether a polygon faces the camera, so hidden faces can be skipped.
- Navigation and robotics: Cross products give perpendicular "steering" directions and compute the area/orientation of GPS-defined regions.
- Structural engineering: Resolving forces onto member axes uses projections (dot products); moment calculations about a pivot use cross products.
Historical Development
- 1799 / 1806: Caspar Wessel and Jean-Robert Argand independently represent complex numbers as directed segments in the plane — an embryonic 2D vector idea.
- 1843: William Rowan Hamilton discovers quaternions, inventing the words scalar and vector; quaternion multiplication secretly contains both dot and cross products.
- 1844: Hermann Grassmann publishes Die lineale Ausdehnungslehre, a far-reaching but largely ignored theory of -dimensional vector spaces and outer products.
- 1853: Hamilton's Lectures on Quaternions spreads the framework, despite its complexity.
- 1881–1884: J. W. Gibbs prints Elements of Vector Analysis for his Yale students, isolating the clean dot and cross products.
- 1880s: Oliver Heaviside, reformulating Maxwell's equations, independently develops the same vector calculus, championing it for physics.
- 1893–1894: The "Great Quaternion Debate" rages in Nature; Gibbs and Heaviside defend vectors against quaternion purists like Peter Tait.
- 1901: Edwin Bidwell Wilson publishes Vector Analysis, based on Gibbs's lectures — the first textbook in the modern notation, cementing today's conventions.
Subtleties & Limits
The cross product as a bilinear, perpendicular-producing operation exists in only two dimensions: 3 and 7 — a deep result tied to the existence of the quaternions and octonions (Hurwitz's theorem on normed division algebras). In all other dimensions, "the area and normal of two vectors" is captured instead by the wedge product of exterior algebra, which produces a bivector rather than a vector. The 3D cross product is really the wedge product followed by the Hodge star that, by happy coincidence of dimension, maps bivectors back to vectors. This is why is technically a pseudovector (axial vector): it flips sign under reflection, unlike ordinary (polar) vectors — a subtlety that matters in physics whenever mirror symmetry is involved.