Vector Direction Calculator — Angle, Bearing & Unit Vector
Enter a 2D vector as x/y components (or magnitude and angle) to find its direction angle from the positive x-axis, compass bearing, reference angle, quadrant, and unit vector — with a live arrow diagram.
Input method
Counter-clockwise angle from the positive x-axis, in degrees
- 1
Magnitude |v|
√(3² + 4²) = 5 - 2
Direction angle θ
atan2(4, 3) × (180 ÷ π) = 53.1301atan2 gives the angle in (−180°, 180°] correctly across all quadrants.
How does this calculator work?
Direction angle θ = atan2(y, x) in degrees (counter-clockwise from +x-axis). Magnitude |v| = √(x² + y²). Unit vector = (x/|v|, y/|v|). Compass bearing = (90° − θ + 360°) mod 360°. Supply components or magnitude + angle; the calculator converts between both forms.
Formula
How this is calculated
The direction of a 2D vector (x, y) is the angle θ it makes with the positive x-axis, measured counter-clockwise. It is computed with the two-argument arctangent function: θ = atan2(y, x), which correctly handles all four quadrants and axis-aligned vectors — unlike simple arctan(y/x) which is ambiguous when x ≤ 0. The result falls in (−180°, 180°] in mathematical convention, or equivalently [0°, 360°) if you add 360° to negative values.
The compass bearing is the navigation equivalent: it measures clockwise from north (the positive y-axis) and is computed as (90° − θ + 360°) mod 360°. Bearing 0° = north, 90° = east, 180° = south, 270° = west — the opposite rotational direction from the mathematical convention.
The reference angle is the positive acute angle between the vector and the nearest x-axis (horizontal), always in [0°, 90°]. The unit vector (x/|v|, y/|v|) has magnitude exactly 1 and the same direction as the original vector — it describes direction without scale, useful in physics for defining force or velocity directions independently of magnitude.
Frequently asked questions
Standard (mathematical) angles are measured counter-clockwise from the positive x-axis (east). Compass bearings are measured clockwise from north (positive y-axis). A vector pointing north-east at 45° from the x-axis has standard angle θ = 45° and compass bearing 45° (coincidentally the same). A vector pointing directly east (θ = 0°) has bearing 90°; one pointing south (θ = −90°) has bearing 180°.
arctan(y/x) only returns angles in (−90°, 90°), so it cannot distinguish between a vector in the first and third quadrants (both have the same y/x ratio). atan2(y, x) takes both components separately and returns the correct angle in (−180°, 180°], covering all quadrants. It also handles the x = 0 case (vectors pointing straight up or down) without a division-by-zero error.
A unit vector (or direction vector) has magnitude exactly 1 and points in the same direction as the original vector. It is found by dividing each component by the magnitude: û = v / |v|. Unit vectors are useful in physics when you want to separate the direction of a quantity (force, velocity, electric field) from its strength. For example, Coulomb's law is often written as F = k·q₁q₂/r² · r̂, where r̂ is the unit vector in the radial direction.
Also known as
TG we-Calculate Editorial Team. (2026). Vector Direction Calculator — Angle, Bearing & Unit Vector [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/vector-direction-calculator
TG we-Calculate Editorial Team. "Vector Direction Calculator — Angle, Bearing & Unit Vector." TG we-Calculate. 2026. https://we-calculate.com/calculator/vector-direction-calculator.
TG we-Calculate Editorial Team, "Vector Direction Calculator — Angle, Bearing & Unit Vector," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/vector-direction-calculator
@misc{wecalculate_vector_direction_calculator, title = {Vector Direction Calculator — Angle, Bearing & Unit Vector}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/vector-direction-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
