Direction Angle of a 2D Vector
Worked example: Components (−1, 1) → direction 135° — press Try an example to run it live, then adjust anything.
Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value. Try different units for next level excitement!
Reading the vector →
Grade 12Grade 12 Math
Test your skills in the Exam Room: new numbers every attempt — free lessons for students, no sign-up, just pure learning. Find 3 more lessons on this formula.
share your results
Direction Angle of a 2D Vector explained
Components tell you where a vector ends; the direction angle tells you which way it leans. Since tan θ = vy/vx, the naive answer is arctan(vy/vx) — and that answer is wrong half the time. The ratio for (−3, −4) is identical to the ratio for (3, 4), so a plain arctan reports a vector pointing southwest as though it pointed northeast. The fix is the two-argument function atan2(vy, vx), which keeps both signs and returns the true bearing anywhere in the full −180° to 180° sweep. It entered programming through early Fortran and is now in every standard library precisely because the quadrant bug was so pervasive.
Example: (−1, 1) points up and to the left, and atan2(1, −1) = 135° — correct, where arctan(1/−1) = −45° would have been off by exactly half a turn. Read the other way, a vector known to lie at 30° with vx = 10 must have vy = 10 tan 30° ≈ 5.774. Straight up or straight down the tangent blows up, which is the arithmetic's honest way of saying a vertical vector has no run to divide by.
Direction Angle of a 2D Vector formula
- = Direction angle from +x axis (°)
- = x-component
- = y-component
Missing one of these? Work it out first, then come back
- Direction angle from +x axis — x-Component from Magnitude and Angle, y-Component from Magnitude and Angle
- x-component — Dot Product of Two 2D Vectors (Components), Dot Product of Two 3D Vectors (Components)
- y-component — Dot Product of Two 2D Vectors (Components), Dot Product of Two 3D Vectors (Components)