Skip to content
math

2D Vector Calculator

Find the magnitude and direction angle of a 2D vector from its x and y components.

Magnitude |v|
5
Direction θ (from +x axis)
53.1301°

How it works

  1. 1Enter the x and y components of vector v to define it in Cartesian form.
  2. 2The magnitude |v| = √(x² + y²) is computed using the Euclidean norm.
  3. 3The direction angle θ is found with atan2(y, x), converted to degrees in [0°, 360°) measured counter-clockwise from the positive x-axis.

Use cases

  • Physics problems — convert a force or velocity from component form into magnitude and bearing.
  • Game development — find the speed and heading of a 2D sprite from its velocity vector.
  • Navigation and robotics — express a displacement as a polar coordinate (r, θ) for path planning.

Frequently asked questions

What is the polar form of a 2D vector?

Polar form expresses a vector as (r, θ): r is the magnitude — how long the vector is — and θ is the direction angle measured counter-clockwise from the positive x-axis. Any Cartesian vector (x, y) converts to polar as r = √(x² + y²) and θ = atan2(y, x).

Why is the direction undefined for the zero vector?

The zero vector (0, 0) has no direction because it points nowhere. atan2(0, 0) is implementation-defined, so the calculator returns — for θ when both components are zero.

In which direction is θ = 0° and which way does it increase?

θ = 0° points along the positive x-axis (east). The angle increases counter-clockwise, so θ = 90° is the positive y-axis (north), θ = 180° is the negative x-axis (west), and θ = 270° is the negative y-axis (south).

See all →