Every Vector Operation Explained, With a Free Vector Calculator
Add, subtract, dot, cross, normalize and measure vectors — what the dot and cross products actually mean, with worked numbers and physics, graphics and game uses.
Every Vector Operation Explained, With a Free Vector Calculator
Vectors are one of those topics where the arithmetic is easy but the meaning hides. You can multiply matching numbers and add them up without ever knowing why the answer tells you whether two arrows point the same way. This guide walks through the six operations you reach for most — add, subtract, dot product, cross product, magnitude and normalize — explains what each one geometrically means, and shows where they pay off in physics, graphics and games. Every step lines up with the vector calculator, so you can punch in the same numbers and watch the result appear.
Add and Subtract: Moving Along Arrows
Adding two vectors means placing them tip to tail and reading the arrow from the very start to the very end. Component-wise it is as plain as it looks:
a + b = (x1 + x2, y1 + y2, z1 + z2)
So (2, 1, 0) + (1, 3, 4) = (3, 4, 4). Subtraction reverses the second arrow before adding it, which gives you the vector that points from b to a. That "from-to" reading is the one to remember: in a physics problem, the displacement from a robot's current position to its target is just target - position. The sign of each component tells you which way to move along that axis.
In practice I lean on subtraction more than addition. When I am debugging a camera that ends up looking the wrong way, the first thing I compute is target - eye — the direction the camera should face. If that vector's components surprise me, the bug is in my coordinates, not my math, and I have narrowed the search in one step.
Magnitude: How Long Is the Arrow
The magnitude (or length, or norm) collapses a vector down to a single number: how far it reaches, regardless of direction. The formula is the Pythagorean theorem stretched into three dimensions:
magnitude = √(x² + y² + z²)
A clean example: the vector (1, 2, 2) has magnitude √(1 + 4 + 4) = √9 = 3. In 2D the third term simply drops out, so (3, 4) measures √(9 + 16) = √25 = 5. Magnitude is how you turn a velocity vector into a speed, a force vector into a push strength, or a position difference into a distance. The calculator runs this through a hypot routine internally, so absurdly large or tiny components do not overflow or lose digits.
Normalize: Keeping Direction, Dropping Size
Normalizing means scaling a vector so its length becomes exactly 1 while its direction stays put. You divide every component by the magnitude:
unit vector = (x, y, z) / magnitude
Normalize (3, 4) and you get (0.6, 0.8), whose length checks out to 1. Unit vectors are the workhorse of any system that cares about direction but not distance: surface normals for lighting, headings for a character, the aim direction of a projectile. One catch the tool guards against — the zero vector has length 0 and no direction, so it cannot be normalized, and the calculator says so rather than handing back a NaN.
The Dot Product: Are These Arrows Aligned
The dot product multiplies matching components and sums them into one scalar:
a · b = x1·x2 + y1·y2 + z1·z2
The number itself is less interesting than its sign. A positive dot product means the two vectors lean the same way; negative means they lean apart; and exactly zero means they are perpendicular. That last fact is the fastest right-angle test in all of geometry — no angle measurement required. Geometrically the dot product equals |a| · |b| · cos θ, which is why dividing it by both magnitudes and taking the arccosine recovers the angle between the vectors.
In games and graphics this single number drives a surprising amount of logic. The brightness of a surface is the dot product of its normal with the light direction. Whether an enemy can "see" the player is often a dot product of the enemy's facing vector with the direction to the player. Back-face culling — skipping triangles that point away from the camera — is just a sign check on a dot product.
Worked Example: Dot Product and Magnitude in 3D
Let me run two concrete vectors all the way through, the way the calculator does. Take:
a = (1, 2, 3)
b = (4, 5, 6)
The dot product:
a · b = 1·4 + 2·5 + 3·6 = 4 + 10 + 18 = 32
A positive 32 tells us these two arrows broadly agree in direction. Now their magnitudes:
|a| = √(1 + 4 + 9) = √14 ≈ 3.742
|b| = √(16 + 25 + 36) = √77 ≈ 8.775
Drop those into the cosine rule and the angle falls out:
cos θ = 32 / (3.742 × 8.775) ≈ 32 / 32.83 ≈ 0.975
θ = arccos(0.975) ≈ 12.93°
So a and b sit roughly 13 degrees apart — nearly parallel, which matches the strong positive dot product. Type the same two vectors into the vector calculator, switch between the dot-product, magnitude and angle operations, and you will see these exact figures without doing the arithmetic by hand.
The Cross Product: Finding the Perpendicular
Where the dot product hands you a number, the cross product hands you a vector — one that points perpendicular to both inputs at once:
a × b = (a2·b3 − a3·b2, a3·b1 − a1·b3, a1·b2 − a2·b1)
For the standard axes (1, 0, 0) × (0, 1, 0) the result is (0, 0, 1) — the third axis, pointing straight up out of the plane the other two define. There is only one such perpendicular direction in 3D space, which is exactly why the cross product is a 3D operation. In 2D there is no third axis to point along, so the calculator reports the signed z-component instead; for (1, 0) and (0, 1) that scalar is 1, and its sign tells you the rotation direction from the first vector to the second.
The cross product is how graphics code builds a surface normal: take two edge vectors of a triangle, cross them, normalize the result, and you have the direction the surface faces for lighting. Its magnitude equals the area of the parallelogram spanned by the two vectors, which physics uses for torque (r × F) and angular momentum. If a 3D scene's lighting looks inverted, a flipped cross-product order — a × b versus b × a, which negates the result — is a prime suspect.
When Dimensions Have to Match
A common stumble: add, subtract, dot and angle all require both vectors to share a dimension. Mixing a 2D vector with a 3D one is a genuine error, not something to paper over by padding a zero, because that silent zero would hide a real input mistake. Magnitude and normalize work on a single vector, so they never have this problem. For heavier linear-algebra work — solving systems, multiplying transforms, taking determinants — vectors give way to grids of numbers, and a matrix calculator is the right next tool.
Master these six operations and most of the vector math in a physics course, a renderer or a game engine stops being mysterious. The dot product tells you alignment, the cross product tells you perpendicular direction, magnitude and normalize separate size from heading, and addition and subtraction move you along the arrows. Keep the vector calculator open as your oracle, check your numbers as you go, and the geometry behind the formulas starts to feel obvious.
Made by Toolora · Updated 2026-06-13