Vector Direction Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the x and y components of a vector to get the angle it points at, its length and its unit vector.
Result
Direction angle (degrees counterclockwise from +x, 0 to 360)
Magnitude |v| = √(x² + y²)
- Unit vector: x ÷ |v|
- Unit vector: y ÷ |v|
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- x component: enter a number.
- y component: enter a number.
- Read the result: Direction angle (degrees counterclockwise from +x, 0 to 360); the panel also shows Magnitude |v| = √(x² + y²), Unit vector: x ÷ |v| and Unit vector: y ÷ |v|.
How this calculator works
The direction of v = (x, y) is the angle θ with tan θ = y ÷ x, taken in the right quadrant with the two-argument arctangent atan2(y, x), then shifted into 0° to 360°.
The magnitude is √(x² + y²) and the unit vector (x ÷ |v|, y ÷ |v|) points the same way with length 1. The zero vector has no direction.
The formula
| Symbol | Meaning |
|---|---|
| x component | |
| y component | |
| Direction angle (degrees counterclockwise from +x, 0 to 360) | |
deg(x) | the angle x, converted from radians to degrees. |
atan2(y, x) | the angle, in radians, of the point (x, y) measured from the positive x-axis. |
Worked example
| x component | 3 |
|---|---|
| y component | 4 |
| Magnitude |v| = √(x² + y²) | 5 |
|---|---|
| Unit vector: x ÷ |v| | 0.6 |
| Unit vector: y ÷ |v| | 0.8 |
Direction angle (degrees counterclockwise from +x, 0 to 360) 53.1301
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the direction of the vector (3, 4)?
arctan(4/3) ≈ 53.1301° from the positive x-axis, with a magnitude of 5.
Why not just use arctan(y/x)?
It cannot tell (3, 4) from (−3, −4). The vector (−2, −2) points at 225°, not 45°.