InfyCalculator
➗

Vector Magnitude & Angle Calculator

Find the magnitude (length) of a 2D or 3D vector and its direction angle from its components.

x component
y component
z component (0 for 2D)
Loading calculator…

How it works

|v| = √(x² + y² + z²) · 2D angle θ = atan2(y, x) · 3D angle from axis = arccos(component ÷ |v|)

The magnitude of a vector is its length, found by the Pythagorean theorem across all components. For a 2D vector the direction is a single angle measured counter-clockwise from the positive x-axis; for a 3D vector, direction is described by three angles, one from each coordinate axis (the direction cosines). Dividing a vector by its magnitude gives a unit vector that keeps the direction but has length 1.

Worked example

For v = (3, 4, 0): the magnitude is √(3² + 4² + 0²) = √25 = 5. Because z = 0 this is a 2D vector; its direction angle is atan2(4, 3) ≈ 53.13° from the positive x-axis, and its unit vector is (0.6, 0.8).

Sources: Euclidean vector — Wikipedia

Frequently asked questions

How is a vector's magnitude calculated?

It is the square root of the sum of the squared components: √(x² + y² + z²). This is the Pythagorean theorem extended to as many dimensions as the vector has, and it always returns a non-negative length.

Why does the zero vector have no angle?

The zero vector (0, 0, 0) has length 0 and points nowhere, so no direction angle or unit vector is defined for it. The calculator returns a dash for those fields rather than dividing by zero.

What is a unit vector used for?

A unit vector has length 1 but keeps the original direction, so it isolates direction from magnitude. It is used to define axes, describe headings, and scale forces or velocities to a chosen size in physics and graphics.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.