# Direction of the Vector Calculator

URL: https://speedycalculator.com/calculators/math/vector-direction/
Last updated: 2026-10-30

> The vector direction calculator finds the direction angle of a 2D vector (0° to 360°), or the three direction angles of a 3D vector, together with its magnitude and unit vector.

## Inputs

- Dimension
- x
- y
- z

## Results

- Direction angle θ (2D, from the x-axis)
- Magnitude |v|
- α (angle with the x-axis)
- β (angle with the y-axis)
- γ (angle with the z-axis)
- Unit vector – x
- Unit vector – y
- Unit vector – z

## Formula

```
2D: θ = atan2(y, x) (adjusted to 0°–360°)
3D: cos α = x/|v|, cos β = y/|v|, cos γ = z/|v|
```

## Explanation

A vector has a size and a direction. The direction angle is measured counter-clockwise from the positive x-axis; in 3D, the angles to each axis (direction cosines) describe it completely.

### How to use the Direction of the Vector Calculator

- **Dimension**
- **x**
- **y**
- **z**

Results update as you type, and everything is calculated in your browser.

### How it works

The magnitude is the square root of the sum of squared components. The 2D angle uses atan2, so vectors in every quadrant get the correct angle.

### Inputs explained

FieldWhat to enterDimensionChoose one: 2D, 3DxA numberyA numberzA number

### What each result means

- **Direction angle θ (2D, from the x-axis)** = mod(deg(atan2([y], [x])), 360)
- **α (angle with the x-axis)** = deg(acos([x]÷sqrt([x]^2 + [y]^2 + [z]^2)))
- **β (angle with the y-axis)** = deg(acos([y]÷sqrt([x]^2 + [y]^2 + [z]^2)))
- **γ (angle with the z-axis)** = deg(acos([z]÷sqrt([x]^2 + [y]^2 + [z]^2)))
- **Unit vector – z** = [z]÷sqrt([x]^2 + [y]^2 + [z]^2)

### Example values

How the main result changes when **x** changes and everything else stays at the example values above:

xDirection angle θ (2D, from the x-axis) (°)-1.5110.556-2.25119.3578-3126.8699-3.75133.1524-4.5138.3665-6146.3099

## Worked example

Inputs — Dimension: 2D; x: -3; y: 4.

Results — **Direction angle θ (2D, from the x-axis) = 126.869898 °**; Magnitude |v| = 5; Unit vector – x = -0.6; Unit vector – y = 0.8.

## Key terms

- **Direction angle**: The angle a vector makes with the positive x-axis.

## FAQ

**What is the direction of (−3, 4)?**
126.87° from the positive x-axis.

**What are direction cosines?**
cos α, cos β and cos γ – the components of the unit vector.

**Why not use arctan(y/x)?**
It gives the wrong quadrant for negative x; atan2 fixes that.

**Do the direction cosines satisfy a rule?**
cos²α + cos²β + cos²γ = 1.


## Sources

- [OpenStax – Calculus Volume 3](https://openstax.org/details/books/calculus-volume-3)
- [Wolfram MathWorld – Vector](https://mathworld.wolfram.com/Vector.html)
