Skip to content

Vector Calculator

Add, subtract and scale 2D and 3D vectors; find magnitude, unit vector, dot and cross product, the angle between them and the resultant with a diagram.

Calculator Details

Resultant a + b:⟨1, 9⟩See results ↓

2D (x, y) or 3D (x, y, z) vectors

Components, or magnitude and direction (2D only, angle counter-clockwise from +x)

x component of a

y component of a

x component of b

y component of b

For the scalar multiple k·a

Your Results

Resultant a + b: ⟨1, 9⟩

Resultant a + b

⟨1, 9⟩

Magnitude 9.055385138 at 83.659808° from +x (bearing 6.3401917°)

  • Dot product a · b

    14

  • Angle between a and b

    58.67130713°

  • Cross product a × b (z only in 2D)

    ⟨0, 0, 23⟩

  • |a|, |b|

    5, 5.385164807

Tip-to-tail diagram

aba + b
a = ⟨3, 4⟩ from the origin, b = ⟨−2, 5⟩ from the tip of a, and the resultant a + b = ⟨1, 9⟩.

a + b = ⟨1, 9⟩, a resultant of magnitude 9.055385138 at 83.65980825° from the +x axis. The dot product a · b is 14, and the angle between them is 58.67130713°.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

Every vector result
ResultRuleValue
aas entered⟨3, 4⟩
bas entered⟨−2, 5⟩
a + bcomponentwise sum⟨1, 9⟩
a − bcomponentwise difference⟨5, −1⟩
2·ak × each component⟨6, 8⟩
|a|√(ax² + ay²)5
|b|length of b5.385164807
|a + b|length of the resultant9.055385138
â (unit a)a ÷ |a|⟨0.6, 0.8⟩
b̂ (unit b)b ÷ |b|⟨−0.3713906764, 0.9284766909⟩
a · bax·bx + ay·by14
a × bdeterminant⟨0, 0, 23⟩
|a × b|parallelogram area23
θarccos(a·b ÷ |a||b|)58.67130713° = 1.024007486 rad
comp_a ba·b ÷ |a|2.8
proj_a b(a·b ÷ |a|²) a⟨1.68, 2.24⟩
Direction of afrom +x, counter-clockwise53.13010235°
Direction of bfrom +x, counter-clockwise111.8014095°

How This Calculator Works

How it's calculated

Vectors add component by component. The magnitude is |a| = √(ax² + ay² + az²), the dot product a · b = ax·bx + ay·by + az·bz = |a||b| cos θ, and the cross product a × b = (ay·bz − az·by, az·bx − ax·bz, ax·by − ay·bx) is perpendicular to both. A vector given by magnitude r and direction θ has components (r cos θ, r sin θ).

With your numbers

a + b = (3 + −2, 4 + 5) = ⟨1, 9⟩
|a + b| = 9.055385138
a · b = 3×−2 + 4×5 = 14
θ = arccos(14 ÷ (5 × 5.385164807)) = 58.67130713°

Frequently Asked Questions

How do I add two vectors?

Add the matching components: ⟨3, 4⟩ + ⟨−2, 5⟩ = ⟨1, 9⟩. Geometrically, place the tail of b at the tip of a (tip to tail); the resultant runs from the start of a to the end of b. Its length here is 9.05539. Subtracting works the same way with the components of b negated.

How do I find the resultant of two forces given as magnitudes and angles?

Split each force into components with x = F cos θ and y = F sin θ (θ measured from the +x axis), add the components, then convert back: magnitude √(x² + y²), direction atan2(y, x). A 30 N force along +x plus a 40 N force along +y gives a resultant of 50 N at 53.1301°. Choose "magnitude and direction" to enter them that way.

What does the dot product tell me?

a · b = |a||b| cos θ, so it measures how much two vectors point the same way. It is positive when the angle between them is under 90°, zero when they are perpendicular and negative when it is over 90°. In physics, the work done by a force is the dot product of the force and the displacement.

What is the cross product and why is it only for 3D?

a × b is a vector perpendicular to both a and b, with length |a||b| sin θ, the area of the parallelogram they span. Its direction follows the right-hand rule. It is defined in three dimensions; for 2D vectors the calculator treats them as lying in the xy-plane (z = 0), so the cross product points along z and its z value is the signed area. Torque and magnetic force are cross products.

How is the angle between two vectors calculated?

From the dot product: θ = arccos(a · b ÷ (|a| |b|)). The result is always between 0° and 180°. It is undefined if either vector is the zero vector, which has no direction.

What is a unit vector?

A vector of length 1 pointing the same way: â = a ÷ |a|. For a = ⟨3, 4⟩, |a| = 5 and the unit vector is ⟨0.6, 0.8⟩. Unit vectors describe directions on their own, and î, ĵ and k̂ are the unit vectors along the axes.

What is the difference between a direction angle and a bearing?

Maths and physics measure direction counter-clockwise from the positive x-axis (east). Navigation bearings are measured clockwise from north. They convert with bearing = 90° − direction, adjusted to 0° to 360°. The calculator shows both for the resultant.

Two vectors in 2D or 3D, in 40-digit decimal arithmetic rounded to 12 significant figures. Directions are measured counter-clockwise from the +x axis; bearings clockwise from north. Not included: more than two vectors at once (add them in pairs), triple products, vectors in more than three dimensions, and units (enter every component in the same unit).

Vector Calculator: Addition, Dot and Cross Products, Magnitude and Angle

By FindMySum · Last reviewed

A vector calculator works with quantities that have both size and direction: forces, velocities, displacements and the arrows of geometry. Enter two vectors in two or three dimensions, as components or as a magnitude and direction, and this one gives their sum and difference, a scalar multiple, both magnitudes and unit vectors, the dot product, the cross product, the angle between them and the projection of one onto the other. In 2D it draws the tip-to-tail diagram of the resultant.

Components, magnitude and direction

A 2D vector a can be written by its components ⟨ax, ay⟩, the distances it moves along x and y. Its magnitude (length) comes from Pythagoras:

|a| = √(ax² + ay²), and in 3D, √(ax² + ay² + az²).

Its direction is the angle θ it makes with the positive x-axis, measured counter-clockwise: θ = atan2(ay, ax). Going the other way, a vector of magnitude r at angle θ has components x = r cos θ and y = r sin θ. This conversion is the heart of most physics problems with forces at angles, and the calculator does it when you choose "magnitude and direction".

Adding and subtracting

Vectors add component by component:

a + b = ⟨ax + bx, ay + by, az + bz⟩

Geometrically, this is the tip-to-tail rule: draw a, then draw b starting where a ends; the resultant runs from the start of a to the end of b. Subtraction adds the opposite vector: a − b = a + (−b). Multiplying by a scalar k stretches the vector by k, and a negative k also reverses it.

Worked example with the defaults

The calculator opens with a = ⟨3, 4⟩ and b = ⟨−2, 5⟩.

  • Sum: ⟨3 + (−2), 4 + 5⟩ = ⟨1, 9⟩, with magnitude √(1 + 81) = √82 ≈ 9.0554, pointing 83.66° from the +x axis.
  • Magnitudes: |a| = √(9 + 16) = 5 and |b| = √(4 + 25) = √29 ≈ 5.3852.
  • Dot product: 3 × (−2) + 4 × 5 = 14.
  • Angle between them: arccos(14 ÷ (5 × 5.3852)) ≈ 58.67°.
  • Cross product: treating both as lying in the xy-plane, a × b = ⟨0, 0, 3 × 5 − 4 × (−2)⟩ = ⟨0, 0, 23⟩. The parallelogram spanned by a and b has an area of 23.
  • Projection of b onto a: 14 ÷ 5 = 2.8 units along a.

The dot product

The dot product multiplies matching components and adds them, giving a single number:

a · b = ax·bx + ay·by + az·bz = |a| |b| cos θ

The second form explains what it means. When the vectors point the same way, cos θ = 1 and the dot product is as large as it can be. When they are perpendicular it is exactly zero, which is the standard test for perpendicular vectors. When they point in roughly opposite directions it is negative. Rearranged, it gives the angle between any two vectors: θ = arccos(a · b ÷ (|a| |b|)).

In physics, work is the dot product of force and displacement. Pushing a 50 N load 10 m along a floor with the force at 30° to the floor does 50 × 10 × cos 30° ≈ 433 J of work, because only the part of the force along the motion counts.

The cross product

The cross product of two 3D vectors is another vector:

a × b = ⟨ay·bz − az·by, az·bx − ax·bz, ax·by − ay·bx⟩

It is perpendicular to both a and b, its direction is given by the right-hand rule (curl the fingers of your right hand from a to b and your thumb points along a × b), and its length is |a| |b| sin θ, the area of the parallelogram the two vectors span. Torque (r × F), angular momentum and the magnetic force on a moving charge are all cross products. Two vectors are parallel exactly when their cross product is the zero vector.

Resultants in physics

When several forces act on an object, it accelerates as if one force, the resultant, acted alone. Two people pulling a sled with 30 N due east and 40 N due north produce a resultant of 50 N about 53° north of east. The same arithmetic combines a boat's velocity with the current, or an aircraft's airspeed with the wind. Enter each one as a magnitude and direction and read the resultant's magnitude, direction and compass bearing.

Checking your work

A few properties make good sanity checks. The magnitude of a sum is never more than the sum of the magnitudes (the triangle inequality). A unit vector always has magnitude 1. The cross product is perpendicular to both inputs, so its dot product with either one is zero. If a result breaks one of these, look for a sign error in a component.

More questions

Is a vector the same as a scalar with a direction?

A vector has both size and direction, while a scalar has only size. Speed (60 km/h) is a scalar; velocity (60 km/h due north) is a vector. Mass, temperature and energy are scalars; force, displacement and acceleration are vectors. Adding vectors has to account for direction, so 3 N and 4 N acting at right angles add up to 5 N, not 7 N.

Does the order matter in vector addition or the cross product?

Addition and the dot product are commutative: a + b = b + a and a · b = b · a. The cross product is not: b × a = −(a × b), the same length pointing the opposite way. Swap the vectors in the calculator and the cross product changes sign.

How do I add three or more vectors?

Add them in pairs: find a + b, then add c to that result. Vector addition is associative, so the order of the pairs doesn't change the final resultant. In components it is simply the sum of all the x components, all the y components and all the z components.

What is the scalar projection used for?

It gives how much of one vector lies along another. The component of gravity pulling a box down a ramp, or the part of the wind that acts along a runway (the headwind component), are projections. The vector projection is the same length pointing along the second vector.

Why does my angle come out as 180° minus what I expected?

The angle between two vectors is measured between their directions when placed tail to tail, and it is always 0° to 180°. If you drew one of them pointing the other way, as is common in force diagrams, you get the supplementary angle. Reverse one vector by changing the signs of its components to check.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy