Calculators/Mathematics/2D vector calculator

2D vector calculator

Addition · magnitude · dot product · angle · drawing

2D vector calculator — illustration
Vector a
xy
Vector b
xy
a + b[4, 6]
a − b[2, 2]
|a|5
|b|2.236
a · b (dot product)11
angle between a and b10.3°

|v| = √(x²+y²). Dot product a·b = aₓbₓ + a_yb_y; angle between vectors: cos θ = a·b / (|a|·|b|). The dashed green arrow is the resultant vector a+b.

Operations on vectors in the plane. Addition and subtraction are done component by component: a⃗+b⃗=[ax+bx, ay+by]\vec{a}+\vec{b}=[a_x+b_x,\ a_y+b_y]. The magnitude (length) of a vector is:

∣a⃗∣=ax2+ay2|\vec{a}|=\sqrt{a_x^2+a_y^2}

The dot product a⃗⋅b⃗=axbx+ayby\vec{a}\cdot\vec{b}=a_x b_x+a_y b_y lets you find the angle between the vectors:

cos⁡θ=a⃗⋅b⃗∣a⃗∣ ∣b⃗∣\cos\theta=\frac{\vec{a}\cdot\vec{b}}{|\vec{a}|\,|\vec{b}|}

The calculator draws both vectors and their resultant. When the dot product is 0, the vectors are perpendicular.

Examples

a = [3, 4]
→ |a| = √(9+16) = 5
a = [3, 4], b = [1, 2]
→ a + b = [4, 6], a·b = 11

Frequently asked questions

How do I check whether two vectors are perpendicular?+

Their dot product must equal zero: a·b = 0. The angle between them is then 90°.

What is the resultant vector?+

The sum of the vectors — in physics, for example, the resultant of several forces. Geometrically it is the diagonal of the parallelogram built on the vectors being added (the parallelogram rule).

Found this calculator useful? Share it.

It's free — send it to a friend who's revising.

Teaching? Embed this calculator on your site.

Free widget — paste it on your school site, blog or notes. It links to the full version.

Teaching a class or tutoring? Guide students in NexTutor →