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).
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
A vector in 2D is an ordered pair, and in 3D an ordered triple, of real numbers (its components):
Derivation hint: components are the signed projections of the vector onto the coordinate axes . Here are real scalars. The standard basis vectors are , , , so . The magnitude (length, norm) is
Derivation hint: apply the Pythagorean theorem twice, once in the -plane and once including the -axis.
For vectors and , the dot product is defined componentwise and equivalently geometrically:
Derivation hint: equate the componentwise sum with the Law of Cosines applied to the triangle formed by , , . where is the angle between the two vectors. The result is a scalar. (For 2D, drop the third term.)
For 3D vectors, the cross product is the vector
Derivation hint: expand the formal determinant along the first row. with magnitude and direction
Derivation hint: square equation [4], add the squared dot product, and use (the Lagrange identity). The direction of is perpendicular to both and , given by the right-hand rule.
The dot product is commutative and distributive:
Derivation hint: both follow immediately from componentwise definition [3] and the commutativity/distributivity of real-number arithmetic. The cross product is anticommutative and not associative:
Derivation hint: swapping and swaps two rows of the determinant in [4], negating it; a matrix with two equal rows has determinant zero.
Why It Holds / Derivation
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,
Derivation hint: standard Law of Cosines with sides , and included angle .
Step 3. Expand the left side using components and [2]:
Derivation hint: expand each square and regroup the cross terms.
Step 4. Compare [8] and [9]. The terms cancel, leaving
Derivation hint: divide both leftover terms by .
∎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 .
Worked Examples
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: .
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]):
Step 3 — magnitude: .
Step 4 — triangle area (half the parallelogram): .
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
Historical Development
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.
See Also
Vector Addition · Orthogonality · Projections · Scalar Triple Product · Determinants · Torque · Work and Energy · Quaternions