Vector Calculator (Add, Subtract, Magnitude, Dot Product and Angle)

Vector Calculator

Vector A
Vector B

Sum A + B:

-


Magnitude |A + B|:

-

Direction of A + B:

-

:

-

:

-

Calculation:

-

This calculator does the basic operations with vectors in the plane and draws them. Add and subtract vectors with the parallelogram or tip-to-tail method, find the magnitude, direction and unit vector, multiply by a scalar, get the dot product and the angle between two vectors, or turn a magnitude and an angle into components.

Drag the tip of an arrow on the graph to change the vector, or type the values. Below the tool you will find the formulas, worked examples and the most common questions.

How to use the vector calculator?

Step 1: Pick what you want to find from the list: add, subtract, magnitude and direction, dot product and angle, scalar multiple, or components from magnitude and angle.

Step 2: Type the components of the vectors. A decimal point or comma both work, for example 2.5 or 2,5, and negative numbers are fine. You can also drag the tips of the arrows.

Step 3: Press Calculate or the Enter key. The results update as you type.

Step 4: Read the results and look at the drawing. The Calculation box shows every operation with your numbers.

Vector formulas in the plane

A vector A = (Ax, Ay) has a magnitude, which is its length, and a direction, which is the angle θ it makes with the positive x-axis, measured counterclockwise:

|A| = √(Ax² + Ay²)
θ = arctan(Ay ÷ Ax), adjusted for the quadrant (+180° when Ax is negative)

The unit vector points the same way as A and has magnitude 1. You get it by dividing each component by the magnitude:

û = A ÷ |A| = (Ax ÷ |A|, Ay ÷ |A|)

Addition and subtraction work component by component. In the drawing, the sum is the diagonal of the parallelogram built on A and B, or the path of A followed by B placed tip to tail. The difference A - B is the arrow from the tip of B to the tip of A.

A ± B = (Ax ± Bx, Ay ± By)

Multiplying by a scalar k stretches the vector (|k| above 1), shrinks it (|k| below 1) and flips it when k is negative. The dot product gives a number, and from it you get the angle between the vectors:

k·A = (k·Ax, k·Ay)
A · B = Ax·Bx + Ay·By = |A| |B| cos θ

If the dot product is 0 the vectors are perpendicular. If it is positive the angle is acute, and if it is negative the angle is obtuse. To go from magnitude and angle to components:

Ax = r cos θ, Ay = r sin θ

Examples of vector operations

Example 1: Add A = (3, 2) and B = (1, 4)

A + B = (3 + 1, 2 + 4) = (4, 6)

|A + B| = √(4² + 6²) = √52 ≈ 7.211

θ = arctan(6 ÷ 4) ≈ 56.31°

In the drawing, A and B placed tip to tail end at the same point as the diagonal of the parallelogram.

Example 2: Magnitude, direction and unit vector of A = (3, 4)

|A| = √(3² + 4²) = √25 = 5

θ = arctan(4 ÷ 3) ≈ 53.13°

û = (3 ÷ 5, 4 ÷ 5) = (0.6, 0.8)

Example 3: Dot product and angle between A = (2, 3) and B = (4, 1)

A · B = 2 × 4 + 3 × 1 = 11

cos θ = 11 ÷ (3.606 × 4.123) ≈ 0.7399

θ = arccos(0.73994) ≈ 42.27°

The dot product is positive, so the angle is acute.

Example 4: Components from magnitude and angle

A force of 10 N makes an angle of 30° with the x-axis.

Fx = 10 × cos(30°) ≈ 8.66

Fy = 10 × sin(30°) = 5

Components of a unit vector table

For a vector of magnitude 1 the components are (cos θ, sin θ). Multiply by the magnitude for other sizes.

Angle θcos θ (x)sin θ (y)
0°10
30°0.8660.5
45°0.70710.7071
60°0.50.866
90°01
120°-0.50.866
135°-0.70710.7071
150°-0.8660.5
180°-10
270°0-1

Frequently asked questions

How do you find the magnitude of a vector?

Square each component, add them and take the square root. For (1, 1): |A| = √(1² + 1²) = √2 ≈ 1.414.

How do you add and subtract vectors?

Component by component. For (3, 2) and (1, 4) the sum is (4, 6) and the difference A - B is (2, -2). Graphically, the sum joins the vectors tip to tail.

What does the dot product mean?

It measures how much two vectors point the same way. If it is 0 they are perpendicular: (3, 2) · (-2, 3) = 0. If it is positive the angle between them is acute, and if it is negative the angle is obtuse.

How do you find the angle between two vectors?

Divide the dot product by the product of the magnitudes to get the cosine, then apply arccos. You can also use the cross product with atan2 for better precision, which is what this calculator does.

What happens when you multiply a vector by a negative number?

The vector flips direction and its length is multiplied by the absolute value of the number. With k = -2 and A = (3, 2) you get (-6, -4).

Learn more

Related calculators

You can explore other calculators here.