Vector Calculator: Magnitude, Angle, Add & Dot Product (2D and 3D)

AlgebraFreeNo sign-up

A vector calculator works component by component. To add vectors, add matching components: ⟨3, 4⟩ + ⟨1, −2⟩ = ⟨4, 2⟩. The magnitude of ⟨3, 4⟩ is √(3² + 4²) = 5, and the dot product ⟨3, 4⟩ · ⟨1, −2⟩ = 3 − 8 = −5, so the angle between the two vectors is about 116.57°. The tool below does this in 2D and 3D with exact square roots.

Vector calculator: pick an operation
Vector a
Vector b
Try:
Add matching components.
Vector addition
a + b⟨4, 2⟩
|a + b|2√5≈ 4.4721

a + b = ⟨3, 4⟩ + ⟨1, −2⟩ = ⟨4, 2⟩, with length 2√5 (≈ 4.4721).

Formula with your numbersa + b = ⟨a₁ + b₁, a₂ + b₂⟩⟨3 + 1, 4 + (−2)⟩ = ⟨4, 2⟩
Direction of a + b≈ 26.5651°
Diagram on the coordinate plane1234−2−11234xyaba + b

Green: a. Gold: b, moved so its tail sits on the tip of a (its original position is dashed). Black: the sum a + b.

Show steps
  1. Line up the components: a = ⟨3, 4⟩ and b = ⟨1, −2⟩.
  2. Add each pair of matching components: ⟨3 + 1, 4 + (−2)⟩ = ⟨4, 2⟩.
  3. Length of the result: |a + b| = √(4² + 2²) = √(20) = 2√5 ≈ 4.4721.
  4. Picture it: put the tail of b on the tip of a (tip-to-tail). The arrow from the start of a to the tip of b is a + b, the diagonal of the parallelogram built on a and b.
Everything about a and b
a ⟨3, 4⟩
b ⟨1, −2⟩
|a| 5
|b| √5 ≈ 2.2361
a + b ⟨4, 2⟩
a − b ⟨2, 6⟩
a · b −5
Angle θ ≈ 116.5651° (≈ 2.0344 rad)
proj of a onto b ⟨−1, 2⟩
a × b (z = 0) ⟨0, 0, −10⟩

Vector Calculator: Magnitude, Angle, Add & Dot Product (2D and 3D)
Embed this calculator on your site

Free to use on class pages, blogs and course pages. Copy the code below and paste it into your page:

How to use the vector calculator

  1. Choose 2D or 3D, and how you want to enter each vector: as components, as a start and end point, or (in 2D) as a magnitude and direction angle.
  2. Pick the operation: add, subtract, scalar multiple, magnitude and unit vector, dot product and angle, cross product, projection or triple products.
  3. Type the components. Whole numbers, decimals, fractions such as 1/3 and roots such as 2√3 or sqrt(2) all work.
  4. Read the answer at the top, in exact form (for example 2√5) with a decimal beside it, and look at the arrow diagram.
  5. Open Show steps for the working, and Everything about a and b for every result at once.

Vector formulas

For a = ⟨a₁, a₂, a₃⟩ and b = ⟨b₁, b₂, b₃⟩ (in 2D, leave out the third component):

Operation Formula Result
Addition a + b = ⟨a₁ + b₁, a₂ + b₂, a₃ + b₃⟩ vector
Subtraction a − b = ⟨a₁ − b₁, a₂ − b₂, a₃ − b₃⟩ vector
Scalar multiple k a = ⟨k a₁, k a₂, k a₃⟩ vector
Magnitude |a| = √(a₁² + a₂² + a₃²) number
Unit vector â = a / |a| vector of length 1
Dot product a · b = a₁b₁ + a₂b₂ + a₃b₃ = |a||b| cos θ number
Angle between θ = arccos(a · b / (|a||b|)) 0° to 180°
Cross product a × b = ⟨a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁⟩ vector (3D)
Projection of a onto b projb a = (a · b / |b|²) b vector
Scalar triple product a · (b × c) number (signed volume)

The direction angle of a 2D vector ⟨x, y⟩ is the angle θ measured counterclockwise from the positive x-axis, with cos θ = x / |v| and sin θ = y / |v|. Always check the quadrant: tan θ = y / x alone cannot tell ⟨1, 1⟩ from ⟨−1, −1⟩.

Vector examples

Magnitude and direction of ⟨−5, 12⟩

The magnitude is √((−5)² + 12²) = √169 = 13. The vector points up and to the left (quadrant II), so θ = 180° − arctan(12/5) ≈ 180° − 67.38° = 112.62°. The unit vector is ⟨−5/13, 12/13⟩.

Angle between ⟨1, 2, 3⟩ and ⟨4, 5, 6⟩

The dot product is 1·4 + 2·5 + 3·6 = 32. The magnitudes are √14 and √77, so cos θ = 32 / √1078 = 32 / (7√22) ≈ 0.9746 and θ ≈ 12.93°. A positive dot product always means an acute angle; a dot product of 0 means the vectors are perpendicular.

Cross product of ⟨3, 4, 2⟩ and ⟨1, −2, 5⟩

x: 4·5 − 2·(−2) = 24. y: 2·1 − 3·5 = −13. z: 3·(−2) − 4·1 = −10. So a × b = ⟨24, −13, −10⟩. Its length is √(576 + 169 + 100) = √845 = 13√5 ≈ 29.07, the area of the parallelogram spanned by a and b. Check: ⟨24, −13, −10⟩ · ⟨3, 4, 2⟩ = 72 − 52 − 20 = 0.

Resultant of two forces

A force of 5 N at 30° and a force of 4 N at 135° act on the same point. In components they are ⟨5 cos 30°, 5 sin 30°⟩ ≈ ⟨4.330, 2.5⟩ and ⟨4 cos 135°, 4 sin 135°⟩ ≈ ⟨−2.828, 2.828⟩. The resultant is their sum, about ⟨1.502, 5.328⟩, with magnitude ≈ 5.536 N at a direction of ≈ 74.26°. Choose “magnitude + angle” in the tool to enter forces this way.

Projection of ⟨3, 4⟩ onto ⟨1, −2⟩

a · b = −5 and |b|² = 5, so projb a = (−5/5)⟨1, −2⟩ = ⟨−1, 2⟩. The negative factor means the shadow of a points against b, which matches the obtuse angle of about 116.57°.

Dot product vs cross product

The dot product gives a number that measures how much two vectors point the same way; it is largest when they are parallel and 0 when they are perpendicular. The cross product works in 3D and gives a new vector perpendicular to both, whose length |a||b| sin θ is the parallelogram area. Order matters for the cross product (b × a = −(a × b)) but not for the dot product. The scalar triple product a · (b × c) combines both: its absolute value is the volume of the box built on three vectors, and it is 0 exactly when the vectors lie in one plane. For ⟨1, 0, 0⟩, ⟨0, 1, 0⟩ and ⟨0, 0, 1⟩ it equals 1, the volume of a unit cube.

Common vector mistakes

  • Typing the wrong sign. A vector pointing left or down has a negative component; ⟨−5, 12⟩ and ⟨5, 12⟩ point in different directions.
  • Subtracting in the wrong order. a − b and b − a are opposite vectors. The vector from point P to point Q is Q − P.
  • Using arctan without the quadrant. arctan(12/−5) gives −67.38°, but ⟨−5, 12⟩ points at 112.62°.
  • Rounding too early. Keep √5 exact until the end; rounding |b| to 2.24 before dividing changes the angle.
  • Forgetting the middle sign in the cross product. The y-component is a₃b₁ − a₁b₃, not a₁b₃ − a₃b₁.
  • Treating the dot product as a vector. a · b is a single number.

When to work by hand

On tests you usually need to show the component work, so practice small problems by hand: write both vectors in component form, apply the formula, then estimate. A sum should look like the diagonal of the parallelogram; a unit vector should have length 1. Use the calculator to check your answer, to handle roots and fractions, and to see the arrow diagram when a sign looks wrong.

Vectors practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. Find ⟨2, −3⟩ + ⟨−5, 7⟩.

Found a mistake? Let us know!

2. What is the magnitude of the vector ⟨6, 8⟩?

Found a mistake? Let us know!

3. Find the dot product ⟨2, 5⟩ · ⟨3, −1⟩.

Found a mistake? Let us know!

4. Are the vectors ⟨4, −6⟩ and ⟨3, 2⟩ perpendicular?

Found a mistake? Let us know!

5. What is the unit vector in the direction of ⟨0, −4⟩?

Found a mistake? Let us know!

6. Find the cross product ⟨1, 0, 0⟩ × ⟨0, 1, 0⟩.

Found a mistake? Let us know!

7. Find 3⟨2, −1, 4⟩.

Found a mistake? Let us know!

8. What is the direction angle of ⟨−1, −1⟩, measured counterclockwise from the positive x-axis?

Found a mistake? Let us know!

9. What is the angle between ⟨1, 0⟩ and ⟨1, 1⟩?

Found a mistake? Let us know!

10. Point P is (1, 2) and point Q is (4, 6). What is the vector from P to Q, and how long is it?

Found a mistake? Let us know!

Frequently asked questions

How do you add vectors?

Add the matching components: ⟨a₁, a₂⟩ + ⟨b₁, b₂⟩ = ⟨a₁ + b₁, a₂ + b₂⟩. On a diagram, place the tail of the second vector at the tip of the first; the sum runs from the start of the first to the tip of the second.

How do you find the resultant vector?

Write every vector in components (for a magnitude r at angle θ, use ⟨r cos θ, r sin θ⟩), add all the x-components and all the y-components, then find the magnitude and direction of the sum. The sum is the resultant.

How do you find a unit vector?

Divide the vector by its magnitude. For ⟨1, 2, 2⟩ the magnitude is √9 = 3, so the unit vector is ⟨1/3, 2/3, 2/3⟩. The zero vector has no unit vector because it has no direction.

How do you multiply vectors?

There are three kinds of multiplication: a scalar multiple k a multiplies each component by k; the dot product a · b gives a number; and the cross product a × b (3D) gives a vector perpendicular to both.

How do you find the magnitude and direction of a vector?

The magnitude of ⟨x, y⟩ is √(x² + y²). The direction is the angle θ from the positive x-axis with cos θ = x / |v| and sin θ = y / |v|, adjusted to the correct quadrant. For ⟨3, 4⟩ that is a magnitude of 5 at about 53.13°.

Related calculators

More algebra calculators

Browse all 206 calculators

Related to This Article

What people say about "Vector Calculator: Magnitude, Angle, Dot & Cross Product"?

No one replied yet.

Leave a Reply