There are three main ways to multiply vectors: scaling a vector by a number (scalar multiplication), multiplying two vectors to get a number (the dot product), and multiplying two vectors to get a new vector (the cross product). Each method has a different formula, produces a different type of result, and solves different kinds of problems.
Scalar Multiplication
The simplest form of vector multiplication is scaling a vector by a regular number, called a scalar. To do it, you multiply each component of the vector by that number. If you have a vector ⟨x, y⟩ and a scalar k, the result is ⟨kx, ky⟩. For example, multiplying the vector ⟨3, 5⟩ by 2 gives ⟨6, 10⟩. The word “scalar” literally means “that which scales,” because all you’re doing is resizing the vector.
The direction stays the same when the scalar is positive. When the scalar is negative, the vector flips to point the opposite way. Multiplying by zero collapses the vector to nothing. This operation works in any number of dimensions: a 3D vector ⟨1, 2, 3⟩ multiplied by 4 becomes ⟨4, 8, 12⟩.
The Dot Product: Two Vectors In, One Number Out
The dot product takes two vectors and returns a single number (a scalar). It measures how much two vectors point in the same direction.
The Component Formula
For two vectors a = ⟨a1, a2, a3⟩ and b = ⟨b1, b2, b3⟩, the dot product is:
a · b = a1b1 + a2b2 + a3b3
You multiply matching components, then add everything up. For two 2D vectors, you just drop the third term. Take a = ⟨2, 3⟩ and b = ⟨4, 1⟩: the dot product is (2)(4) + (3)(1) = 11.
The Angle Formula
There’s a second, equivalent formula that uses the angle between the two vectors:
a · b = ‖a‖ ‖b‖ cos θ
Here, ‖a‖ and ‖b‖ are the lengths (magnitudes) of each vector, and θ is the angle between them. This version is especially useful when you already know the angle, or when you want to find the angle. Rearranging gives you cos θ = (a · b) / (‖a‖ ‖b‖), which lets you calculate the angle between any two vectors directly from their components.
What the Dot Product Tells You
The sign of the dot product reveals the general relationship between two vectors. A positive result means they point roughly the same direction (the angle between them is less than 90°). Zero means they’re perpendicular. A negative result means they point in roughly opposite directions (the angle is greater than 90°). In physics, the dot product calculates work: when a force pushes an object along a path, only the part of the force aligned with the direction of motion does work. That alignment is exactly what the dot product captures.
The Cross Product: Two Vectors In, One Vector Out
The cross product takes two vectors and produces a third vector that is perpendicular to both of them. Unlike the dot product, the cross product only works in three dimensions (there’s also a version in seven dimensions, but that’s a topic for abstract algebra, not everyday math).
The Component Formula
For a = ⟨a1, a2, a3⟩ and b = ⟨b1, b2, b3⟩, the cross product is:
a × b = ⟨a2b3 − a3b2, a3b1 − a1b3, a1b2 − a2b1⟩
That formula is hard to memorize on its own, so most people use a determinant trick. You set up a 3×3 grid with the unit vectors i, j, k across the top row, the components of a in the middle row, and the components of b in the bottom row:
| i j k |
| a1 a2 a3 |
| b1 b2 b3 |
Expanding this determinant along the top row gives you the cross product. The i component is (a2b3 − a3b2), the j component is −(a1b3 − a3b1), and the k component is (a1b2 − a2b1). Notice the negative sign on the j term; that’s easy to forget and a common source of errors.
A Worked Example
Let a = ⟨2, 3, 4⟩ and b = ⟨5, 6, 7⟩. The cross product a × b breaks down as:
- i component: (3)(7) − (4)(6) = 21 − 24 = −3
- j component: −[(2)(7) − (4)(5)] = −[14 − 20] = 6
- k component: (2)(6) − (3)(5) = 12 − 15 = −3
The result is ⟨−3, 6, −3⟩. You can verify this is perpendicular to both original vectors by checking that the dot product with each one equals zero: (2)(−3) + (3)(6) + (4)(−3) = −6 + 18 − 12 = 0. It checks out.
The Angle Formula
The cross product also has a geometric version. The magnitude of the resulting vector is:
‖a × b‖ = ‖a‖ ‖b‖ sin θ
This means the cross product’s magnitude equals the area of the parallelogram formed by the two vectors. When the vectors are parallel (θ = 0° or 180°), sin θ is zero, so the cross product is the zero vector. When they’re perpendicular, sin θ is 1, and the magnitude is maximized.
Finding the Direction: The Right-Hand Rule
Since the resulting vector is perpendicular to both inputs, there are two possible directions it could point (up or down from the plane of the two vectors). The right-hand rule resolves this. Place the heel of your right hand where the tails of the two vectors meet, then curl your fingers from the first vector (a) toward the second vector (b). Your thumb points in the direction of a × b.
This means order matters. Swapping the vectors reverses the direction: a × b = −(b × a). This property is called anticommutativity, and it contrasts with the dot product, where a · b always equals b · a.
Dot Product vs. Cross Product at a Glance
- Output type: The dot product returns a scalar (a single number). The cross product returns a vector.
- Dimensions: The dot product works in any number of dimensions. The cross product is defined only in 3D.
- Angle relationship: The dot product uses cosine, measuring alignment. The cross product uses sine, measuring “perpendicularity.”
- Order sensitivity: The dot product is commutative (a · b = b · a). The cross product is anticommutative (a × b = −b × a).
- Geometric meaning: The dot product measures projection of one vector onto another. The cross product gives the area of the parallelogram spanned by the two vectors, along with a direction perpendicular to both.
When Each Type Gets Used
The dot product shows up whenever you need to measure how aligned two directions are. In physics, work is the dot product of force and displacement. In computer graphics, lighting calculations use the dot product of a surface’s normal direction and the direction of incoming light to determine brightness. Any time you’re projecting one vector onto another, the dot product is the tool.
The cross product appears when rotation or perpendicularity matters. Torque, the twisting force you apply when turning a wrench, is calculated as the cross product of the lever arm and the applied force. When the force is perpendicular to the wrench handle, torque is maximized; when the force is parallel to the handle, the cross product is zero and nothing turns. The cross product also defines the direction a charged particle curves when it moves through a magnetic field, and in 3D graphics, it’s used to find surface normals for rendering.
Computing Vector Products in Code
In Python, the NumPy library handles both operations. For the dot product, use numpy.dot(a, b) or the @ operator (which calls numpy.matmul). For the cross product, use numpy.linalg.cross(a, b). Scalar multiplication needs no special function since multiplying an array by a number applies it to every element automatically: 3 * numpy.array([1, 2, 3]) returns [3, 6, 9].
Most other languages and math libraries follow similar conventions. MATLAB uses dot(a, b) and cross(a, b). In Unity (C#), the Vector3 class has Vector3.Dot() and Vector3.Cross(). The names are nearly universal across platforms, which makes translating between languages straightforward.

