Vector Magnitude & Direction Calculator
Calculate vector magnitude, direction angle, unit vectors, and perform vector addition and dot products in 2D and 3D. With step-by-step working.
As an Amazon Associate and CJ Affiliate publisher we earn from qualifying purchases. Prices and availability may vary.
Vectors Guide
What should I know about Magnitude and Direction?
A vector has both magnitude (size) and direction, unlike a scalar which has magnitude only. The magnitude of a 2D vector (x, y) = √(x² + y²). For vector (3, 4): magnitude = √(9+16) = √25 = 5. The direction angle θ from the positive x-axis: θ = arctan(y/x). For (3, 4): θ = arctan(4/3) = 53.1°. For 3D vector (x, y, z): magnitude = √(x² + y² + z²). The unit vector (a vector of magnitude 1 in the same direction) = original vector divided by its magnitude: (3/5, 4/5) = (0.6, 0.8) for our example.
What should I know about Vector Addition?
Vectors add component by component: (a, b) + (c, d) = (a+c, b+d). Geometrically, this is the tip-to-tail rule — place the second vector at the tip of the first; the resultant goes from the tail of the first to the tip of the second. Example: velocity vector (30, 0) m/s (boat moving east) plus current vector (0, 5) m/s (current moving north) = resultant (30, 5) m/s. Magnitude: √(900+25) = 30.4 m/s. Direction: arctan(5/30) = 9.5° north of east.
What do I need to know about The Dot Product?
The dot product of two vectors a·b = a₁b₁ + a₂b₂ (2D) or a₁b₁ + a₂b₂ + a₃b₃ (3D). It also equals |a||b|cos(θ), where θ is the angle between them. This property is used to find the angle between vectors. If the dot product = 0, the vectors are perpendicular (cos 90° = 0). Applications: calculating work done (W = F·d, force dotted with displacement), finding the angle of incidence in optics and collision physics, projecting one vector onto another in navigation.
What should I know about Vectors in Physics and Engineering?
Vectors appear throughout physics and engineering. Forces are vectors — adding the weight vector (downward) and the normal reaction vector (perpendicular to surface) gives the net force. Velocity and acceleration are vectors. Electric and magnetic fields are vector fields. Structural engineering: the equilibrium of forces (all vectors summing to zero) determines whether a structure is stable. Navigation: velocity vectors (speed and direction) combined with wind or current vectors give the actual ground speed and heading a pilot needs to fly.
What do I need to know about Distance Between Two Points?
The magnitude of a vector is exactly how you calculate the straight-line distance between two points: form the displacement vector by subtracting coordinates (x₂−x₁, y₂−y₁[, z₂−z₁]), then take its magnitude. For points A(1, 2) and B(4, 6): displacement = (3, 4), magnitude = √(3² + 4²) = √25 = 5. This is the 2D distance formula in disguise — it's literally the Pythagorean theorem applied to the differences in coordinates. In 3D, the same idea extends with a third term: distance between (1,2,3) and (4,6,8) = √(3² + 4² + 5²) = √50 ≈ 7.07. This connection matters because it means every distance problem — between two GPS coordinates projected onto a plane, two points on a technical drawing, or two particles in a physics simulation — is a magnitude calculation. It also explains why magnitude is always non-negative: distance can never be negative.
What do I need to know about Normalising a Vector?
Dividing a vector by its own magnitude produces a unit vector — a vector with magnitude exactly 1 that points in the same direction as the original. For v = (3, 4), |v| = 5, so the unit vector is (3/5, 4/5) = (0.6, 0.8). Check: √(0.6² + 0.8²) = √(0.36 + 0.64) = √1 = 1. Normalising is essential in computer graphics and physics because many formulas need pure direction information without magnitude mixed in — for example, computing a surface normal for lighting, or finding the direction of a force without its strength. To scale a unit vector to any desired length L, multiply each component by L: a unit vector times 10 is a vector of length 10 pointing the same way. A zero vector (0,0,0) cannot be normalised since division by its magnitude of zero is undefined — this is a common edge case to check for in code.
What do I need to know about Magnitude in Higher Dimensions?
The magnitude formula generalizes naturally beyond 2D and 3D: for a vector with components (x₁, x₂, ..., xₙ) in n-dimensional space, the magnitude is √(x₁² + x₂² + ... + xₙ²), simply extending the Pythagorean pattern to however many components the vector has. This matters in fields like data science and machine learning, where a "vector" might represent dozens or thousands of features describing a data point (a customer's purchase history, a document's word frequencies, an image's pixel values), and the magnitude of the difference between two such vectors is used as a measure of how dissimilar they are. Despite the abstraction, the underlying arithmetic never changes — square every component, sum the squares, take the square root — which is exactly why vector magnitude calculations scale cleanly to problems far removed from the geometric arrows most people first learn them with.
Worked Example: Resultant of Two Perpendicular Vectors
A hiker walks 300 m east, then 400 m north. The resultant displacement vector has components (300, 400). Its magnitude is found with the Pythagorean theorem, which is exactly the 2D vector magnitude formula: |v| = √(300² + 400²) = √(90,000 + 160,000) = √250,000 = 500 m The direction is θ = atan(400/300) = atan(1.333) ≈ 53.13° north of east. Note this is the same 3-4-5 ratio scaled by 100 (300 = 3×100, 400 = 4×100, 500 = 5×100) — a useful pattern to recognise since 3-4-5 right triangles appear constantly in vector problems. If a third leg of 1200 m were added straight up (in a z-direction, for a 3D displacement), the full 3D magnitude would be |v| = √(300² + 400² + 1200²) = √(90,000+160,000+1,440,000) = √1,690,000 ≈ 1300 m.
Worked Example: Finding the Angle Between Two Vectors
Find the angle between vectors a = (3, 4) and b = (4, -3) using the dot product formula, cos θ = (a·b)/(|a||b|). First the dot product: a·b = (3)(4) + (4)(-3) = 12 - 12 = 0. Since the dot product is zero, cos θ = 0, meaning θ = 90° — these two vectors are perpendicular. This makes sense geometrically: a = (3,4) and b = (4,-3) are the same pair of components with the sign and order swapped, which is exactly the transformation that rotates a 2D vector by 90°. A quick general rule worth remembering: for any 2D vector (x, y), the vector (y, -x) or (-y, x) is always perpendicular to it, with the same magnitude — a useful shortcut for constructing a perpendicular vector without doing any trigonometry at all.
Worked Example: Normalising a Vector to Unit Length
Normalise the vector v = (6, 8) — that is, find a vector pointing in the same direction but with magnitude exactly 1. First find the magnitude: |v| = √(6² + 8²) = √(36+64) = √100 = 10. Divide each component by the magnitude: unit vector = (6/10, 8/10) = (0.6, 0.8). Checking: |(0.6, 0.8)| = √(0.36+0.64) = √1.0 = 1 ✓. Unit vectors like this are used constantly in physics and graphics to represent pure direction separately from magnitude — for example, a force of 50 N acting in the direction of v = (6,8) can be written as 50 × (0.6, 0.8) = (30, 40) N, cleanly separating 'how much' from 'which way' without having to re-derive the direction every time the magnitude changes.
Worked Example: Distance Between Two Points as a Vector Magnitude
The distance between two points is simply the magnitude of the vector connecting them. Find the distance between A(1, 2) and B(5, 7). The connecting vector is B - A = (5-1, 7-2) = (4, 5). Its magnitude is |v| = √(4² + 5²) = √(16+25) = √41 ≈ 6.40 units. This is exactly the distance formula taught in coordinate geometry, √[(x₂-x₁)² + (y₂-y₁)²], just expressed through vector subtraction and magnitude instead — a useful reframing, since it means every distance calculation, in 2D, 3D, or higher, is really just 'subtract the points, then find the magnitude', with no separate formula needed for each dimension.