Compute the magnitude |v| and direction angle θ of a 2D vector ⟨a, b⟩ using the Pythagorean theorem and atan2. Also decompose a vector given its magnitude and direction into component form. See the unit vector, reference angle, quadrant, and a live canvas diagram — with full step-by-step work.
Input
Examples
Examples
Results
Magnitude: Length of the Vector (Pythagorean Theorem)
|v| = √(a² + b²) for v = ⟨a, b⟩
The magnitude of a vector is its length — the distance from the tail (origin) to the tip. It is always a non-negative number.
Draw the vector as the hypotenuse of a right triangle: the horizontal leg has length |a| and the vertical leg has length |b|. The Pythagorean theorem gives |v|² = a² + b², so |v| = √(a² + b²).
The direction angle θ is measured counterclockwise from the positive x-axis. Use atan2(b, a) (not plain arctan) so the quadrant is handled automatically. The result is mapped to [0°, 360°).
The unit vector v̂ = ⟨a/|v|, b/|v|⟩ has magnitude 1 and points in the same direction as v. It is useful for expressing direction without scale.
Component Form vs. Magnitude-Direction Form
⟨a, b⟩ ⟺ (|v|, θ) a = |v|cosθ, b = |v|sinθ
Component form ⟨a, b⟩ is best for addition, subtraction, and dot products — you simply operate component-by-component.
Magnitude-direction form (r, θ) is best for describing physical quantities like force, velocity, or displacement where the "how strong" and "which way" are more intuitive than x- and y-components separately.
Decomposing a vector (Mode B) reverses the process: given a force of 10 N at 30°, the horizontal component is 10 cos 30° ≈ 8.66 N and the vertical component is 10 sin 30° = 5 N. This is fundamental in physics (projectile motion, static equilibrium) and engineering.
The reference angle is the acute angle between the vector and the nearest horizontal axis — always in [0°, 90°]. It makes computing trig values easier for non-standard angles.
Work through problems live with a tutor — magnitude, direction, dot products, and applications explained step by step.