Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Vector Direction Calculator

x component: enter a number. Prefilled example: 3.

y component: enter a number. Prefilled example: 4.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. x component: enter a number.
  2. y component: enter a number.
  3. 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

  1. Dir={deg⁡(atan2⁡(y,x))+360if deg⁡(atan2⁡(y,x))<0deg⁡(atan2⁡(y,x))otherwise
Symbols used in the formula
SymbolMeaning
xx component
yy component
DirDirection 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 component3
y component4
Magnitude |v| = √(x² + y²)5
Unit vector: x ÷ |v|0.6
Unit vector: y ÷ |v|0.8
  1. Dir=deg⁡(atan2⁡(4,3))=53.1301

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°.

Related calculators