2D Vector Calculator

Add, subtract, dot, normalize and angle-between two 2D vectors.

Open tool

Overview

The 2D Vector Calculator handles the four operations you reach for daily when working with planar geometry: addition, subtraction, the dot product and normalisation. It also reports the angle between two vectors so you don't have to remember acos((u . v) / (|u| |v|)) every time.

It is built for game developers writing movement and steering code, physics students checking homework and front-end engineers reasoning about drag deltas. If you find yourself opening a Python REPL to add two arrows, this tool removes that step.

How it works

Each vector v = (vx, vy) is represented by its two Cartesian components. Addition and subtraction are component-wise: (a + b) = (ax + bx, ay + by). The dot product is a . b = ax*bx + ay*by, which is also |a| |b| cos θ, so the angle between two non-zero vectors is θ = acos((a . b) / (|a| |b|)).

Normalisation produces the unit vector a_hat = a / |a| where |a| = sqrt(ax^2 + ay^2) is the Euclidean magnitude. Numerical safeguards return zero for the unit vector of a zero-magnitude input so you don't get NaN downstream.

Examples

(3, 4) + (1, 2)  →  (4, 6)
(3, 4) . (1, 2)  →  11
normalize(3, 4)  →  (0.6, 0.8)
angle between (1, 0) and (0, 1)  →  90 degrees

FAQ

What does the dot product tell me?

It measures how aligned two vectors are. A positive dot product means they point roughly the same way, zero means perpendicular and negative means opposite directions.

Is the angle signed?

No — the dot product gives the unsigned angle between 0 and 180 degrees. To get a signed angle from one vector to another, use the cross-product sign as a tiebreaker.

Why is the unit vector zero when the input is zero?

A zero-length vector has no direction, so any unit-length result would be arbitrary. Returning zero is the safer default in most rendering and physics code.

Are inputs limited to integers?

No, any decimal works. Results are computed in double precision.

Can I subtract by entering a negative?

Yes, but the dedicated subtract operation is shorter and matches the way most code reads.

Try 2D Vector Calculator

An unhandled error has occurred. Reload ×