Vector Magnitude and Direction Calculator
This vector magnitude calculator gives the length and the direction of a vector, with the length left as an exact square root and the angle worked out so the quadrant is right.
Type 3i + 4j and you get 5 at 53.13°. Type <-3, 4> and you get 5 at 126.87° — not the −53.13° your calculator's tan button will hand you.
A Vector Magnitude Calculator Answers Two Questions, and Only Two
A vector is an arrow. How long it is, and which way it points. Everything on this page is one of those two things.
Length comes straight from Pythagoras. The components are the two sides of a right-angled triangle and the vector is the hypotenuse, so squaring, adding and rooting is the whole method. Three components in space simply means a third square joins the sum.
Direction is the angle measured anticlockwise from the positive x-axis. That part is where the trouble lives.
Vector Magnitude Is Usually a Surd, So Leave It as One
3i + 4j is the textbook example precisely because it works out neatly: √(9 + 16) = √25 = 5. Almost nothing else does.
Take the vector (2, 3): its magnitude is √13. Not 3.6056. Not 3.60555128. √13, which is exact, shorter to write, and the form an exam expects when it asks for an exact answer. Round it and the error travels into every line that follows.
Reducing the surd is the other place marks go astray. The magnitude of (2, 4) is √20, and √20 is not a finished answer — 20 has a square factor, so it becomes 2√5. This page pulls out the largest square factor every time, so what you copy down is already in the form a marker wants.
Where the Tan Button Lies to You
Here is the mistake this topic is known for.
To find the direction of (−3, 4) you would reach for θ = tan⁻¹(y/x) = tan⁻¹(4 ÷ −3) and your calculator returns −53.13°. That angle points down and to the right. The vector points up and to the left. They are 180° apart.
Why? Tangent repeats every 180°, so tan⁻¹ cannot tell a direction from its exact opposite. The ratio 4 ÷ −3 is the same as −4 ÷ 3, and those are two different vectors. Nothing in the ratio records which one you meant.
What fixes it is looking at the signs of x and y separately, which is what the function atan2 does and what this page uses. Feed it x = −3 and y = 4 and it returns 126.87°, because a negative x with a positive y can only be quadrant 2.
| Signs of x and y | Quadrant | Fix the tan answer by |
|---|---|---|
| both positive | 1 | nothing |
| x negative, y positive | 2 | adding 180° |
| both negative | 3 | adding 180° |
| x positive, y negative | 4 | adding 360° |
Learn the table if you like. Sketching the arrow first is faster and harder to get wrong, and it is what this page does for you in the working.
Three Dimensions Need Three Angles
A vector in space cannot be pinned down by one angle. It takes three: one to each axis, written α, β and γ.
Divide each component by the magnitude and you get the direction cosines, and the inverse cosine of each gives its angle. For 2i − 3j + 6k the magnitude is a tidy 7, and the angles come to 73.40°, 115.38° and 31.00°.
A free check comes with this. Those three cosines, squared, always add to exactly 1. If yours do not, one of your angles is wrong, and you have found that out in a single line rather than by redoing everything.
The Zero Vector Is Not an Error
Enter (0, 0) and the length is 0 and the direction is undefined.
Undefined, not 0°. An arrow of no length does not point anywhere, so there is no angle to report. Tools that quietly return 0° for this are wrong, and a question that produces a zero vector usually means something in the physics cancelled out — which is the interesting part, not a failure.
How to Use This Vector Magnitude Calculator
Write the vector the way your question does. 3i + 4j, <3, 4>, (3, 4) and plain 3, 4 are all read the same way, and three components give a 3D vector. Fractions and decimals are fine and stay exact: (1/2, 1/3) comes back as (1/6)√13 rather than 0.6009.
Results come back as a surd with the decimal under it, the direction in degrees and radians, and the quadrant. When the tan button would have given a different answer, the page says so and prints both, because knowing you were about to be wrong is worth more than the right number on its own.
Before anything appears the answer is checked: the surd is squared back to see that it reproduces |v|² exactly, the surd is re-factored to confirm nothing square is left inside it, and the angle is used to rebuild the original components. For a 3D vector the direction cosines are squared and must total 1. The number of checks that passed is printed with the working. The length itself is exactly what the distance formula computes, with one of the two points pinned at the origin.
Vector Magnitude and Direction Calculator FAQ
How do you find the magnitude of a vector?
What is the magnitude of the vector 3i + 4j?
How do you find the direction of a vector?
Why does tan inverse give the wrong angle?
Should the magnitude be left as a square root?
How do you simplify a surd like the square root of 20?
How do you find the direction of a 3D vector?
What is the magnitude of the zero vector?
Square, add, root — then look at the signs before you trust the angle.