Vector Calculator

Use this Vector Calculator to enter values, adjust options, and review results in a compact responsive workspace.

Results are calculated automatically as you enter data.

Vector A
Vector B

A + B

▼ See explanations and tips below ▼

What Are Vector Operations?

A vector is a quantity with both size and direction. In coordinate form, a vector is written as an ordered list of components, such as \(A = (a_x, a_y)\) in 2D or \(A = (a_x, a_y, a_z)\) in 3D. The components tell you how far the vector points along each coordinate axis.

Vector operations are the basic ways to combine, compare, scale, and analyze vectors. Addition and subtraction combine vectors component by component. Scalar multiplication stretches, shrinks, or reverses a vector. The dot product connects vectors to angles and projections. The cross product, in 3D, produces a vector perpendicular to two input vectors.

These operations are used throughout algebra, precalculus, calculus, physics, engineering, computer graphics, robotics, navigation, and any subject that works with direction and magnitude.


Why Vector Operations Matter

Vectors let you describe more than just “how much.” They also describe “which way.” That makes them useful whenever a quantity has direction: displacement, velocity, force, acceleration, electric fields, surface normals, or movement on a coordinate grid.

Vector operations help answer practical questions such as:

  • What is the combined effect of two movements or forces?
  • How far apart are two directions?
  • Is one vector perpendicular to another?
  • How much of one vector points in the direction of another?
  • What vector is perpendicular to two vectors in 3D space?

Because the same component rules work in many settings, learning vector operations builds a bridge between classroom math and real-world modeling.


Key Terms to Know

  • Vector: A quantity with magnitude and direction, often written with components.
  • Component: One coordinate part of a vector, such as \(a_x\), \(a_y\), or \(a_z\).
  • Scalar: A single number used to scale a vector.
  • Magnitude: The length of a vector, written as \(|A|\) or \(\|A\|\).
  • Dot product: A vector product that returns a scalar and is closely related to the angle between two vectors.
  • Cross product: A vector product that returns a vector perpendicular to two 3D vectors.
  • Projection: The part of one vector that lies in the direction of another vector.
  • Zero vector: A vector with all components equal to zero, such as \((0, 0)\) or \((0, 0, 0)\).

How Vector Operations Work

Let

$$ A = (a_x, a_y, a_z) $$

and

$$ B = (b_x, b_y, b_z) $$

In 2D, the \(z\)-components are treated as zero, so \(A = (a_x, a_y, 0)\) and \(B = (b_x, b_y, 0)\).

Addition and subtraction

Vector addition and subtraction are done component by component:

$$ A + B = (a_x + b_x,\ a_y + b_y,\ a_z + b_z) $$
$$ A - B = (a_x - b_x,\ a_y - b_y,\ a_z - b_z) $$

Geometrically, \(A + B\) represents the combined movement of first following one vector and then the other. \(A - B\) can be thought of as adding the opposite of \(B\).

Scalar multiplication

A scalar multiplies every component of the vector:

$$ kA = (ka_x,\ ka_y,\ ka_z) $$

If \(k > 1\), the vector gets longer. If \(0 < k < 1\), it gets shorter. If \(k < 0\), the vector reverses direction and may also change length. If \(k = 0\), the result is the zero vector.

Magnitude

The magnitude of a vector is its length:

$$ |A| = \sqrt{a_x^2 + a_y^2 + a_z^2} $$

For a 2D vector, this becomes:

$$ |A| = \sqrt{a_x^2 + a_y^2} $$

This formula comes from the distance formula and the Pythagorean theorem.

Dot product

The dot product multiplies matching components and adds the results:

$$ A \cdot B = a_xb_x + a_yb_y + a_zb_z $$

The dot product is a scalar, not a vector. It can be used to find the angle between two nonzero vectors:

$$ A \cdot B = |A||B|\cos(\theta) $$

Solving for the angle gives:

$$ \theta = \cos^{-1}\left(\frac{A \cdot B}{|A||B|}\right) $$

A positive dot product means the angle is acute. A dot product of zero means the vectors are perpendicular, as long as both vectors are nonzero. A negative dot product means the angle is obtuse.

Cross product

In 3D, the cross product of two vectors is:

$$ A \times B = (a_yb_z - a_zb_y,\ a_zb_x - a_xb_z,\ a_xb_y - a_yb_x) $$

The result is a vector perpendicular to both \(A\) and \(B\), with direction determined by the right-hand rule.

In 2D, the full cross product is not shown as a 3D vector. Instead, the useful value is the \(z\)-component you would get if both vectors were placed in the \(xy\)-plane:

$$ \text{cross}_{2D} = a_xb_y - a_yb_x $$

This signed value is often used to understand orientation in the plane. Its sign tells whether the turn from one vector to the other is clockwise or counterclockwise, depending on the coordinate convention being used.

Projection of one vector onto another

The projection of \(A\) onto \(B\) is the part of \(A\) that points in the direction of \(B\):

$$ \operatorname{proj}_{B} A = \left(\frac{A \cdot B}{|B|^2}\right)B $$

This requires \(B\) to be nonzero. If \(B\) has zero length, there is no direction to project onto.


Examples of Vector Operations in Practice

Example 1: Basic 2D vectors

Let:

$$ A = (3, 4) $$
$$ B = (1, 2) $$

Add the vectors:

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

Subtract the vectors:

$$ A - B = (3 - 1,\ 4 - 2) = (2, 2) $$

Multiply \(A\) by the scalar \(2\):

$$ 2A = (2 \times 3,\ 2 \times 4) = (6, 8) $$

Find the magnitude of \(A\):

$$ |A| = \sqrt{3^2 + 4^2} = \sqrt{25} = 5 $$

Find the dot product:

$$ A \cdot B = 3(1) + 4(2) = 11 $$

The vectors point in nearly the same direction because the dot product is positive and the angle between them is small.


Example 2: 3D vectors with a cross product

Let:

$$ A = (2, -1, 3) $$
$$ B = (4, 0, -2) $$

Add the vectors:

$$ A + B = (2 + 4,\ -1 + 0,\ 3 + (-2)) = (6, -1, 1) $$

Find the dot product:

$$ A \cdot B = 2(4) + (-1)(0) + 3(-2) = 2 $$

Find the cross product:

$$ A \times B = ((-1)(-2) - 3(0),\ 3(4) - 2(-2),\ 2(0) - (-1)(4)) $$
$$ A \times B = (2, 16, 4) $$

This cross product is perpendicular to both original vectors.

The projection of \(A\) onto \(B\) is:

$$ \operatorname{proj}_{B} A = \left(\frac{2}{4^2 + 0^2 + (-2)^2}\right)(4, 0, -2) $$
$$ \operatorname{proj}_{B} A = \left(\frac{2}{20}\right)(4, 0, -2) = (0.4, 0, -0.2) $$

Example 3: Zero-vector edge case

Let:

$$ A = (0, 0) $$
$$ B = (5, -2) $$

The sum is:

$$ A + B = (5, -2) $$

The magnitude of \(A\) is:

$$ |A| = \sqrt{0^2 + 0^2} = 0 $$

Because \(A\) is the zero vector, the angle between \(A\) and \(B\) is not defined. A zero vector has no direction, so it cannot form a meaningful angle with another vector.

The projection of \(A\) onto \(B\) is still defined here because \(B\) is nonzero:

$$ \operatorname{proj}_{B} A = \left(\frac{0}{|B|^2}\right)B = (0, 0) $$

If \(B\) were also the zero vector, projection onto \(B\) would be unavailable because there would be no direction to project onto.


How to Interpret the Result

The meaning of each result depends on the operation:

  • \(A + B\): The combined vector formed by adding matching components.
  • \(A - B\): The vector difference, found by subtracting matching components.
  • Scalar multiple \(kA\): A stretched, shrunk, reversed, or zeroed version of \(A\), depending on the scalar.
  • Dot product: A scalar that helps describe the angle relationship between the vectors.
  • Cross result: In 2D, a signed scalar \(z\)-component. In 3D, a full vector perpendicular to both vectors.
  • \(|A|\) and \(|B|\): The lengths of the vectors in coordinate units.
  • Angle: The smaller angle between two nonzero vectors, reported in degrees.
  • Projection of \(A\) on \(B\): The component of \(A\) that lies along the direction of \(B\).

A low or high result is not automatically “good” or “bad.” For example, a large magnitude simply means the vector is long in coordinate units. A dot product near zero suggests the vectors are close to perpendicular, while a large positive or negative dot product reflects both vector length and direction.


Common Mistakes and Misconceptions

  • Forgetting that blank entries become zero: Leaving a coordinate empty may unintentionally create a zero component or even a zero vector.
  • Expecting 3D behavior while in 2D mode: In 2D mode, \(z\)-components are treated as zero.
  • Confusing the 2D cross value with the 3D cross product: The 2D result is a signed scalar value, not a full vector.
  • Trying to find an angle with a zero vector: A zero vector has no direction, so the angle is unavailable.
  • Projecting onto a zero vector: Projection onto \(B\) requires \(B\) to have a nonzero magnitude.
  • Mixing units without thinking: Coordinates are treated as unitless. If your vectors represent real measurements, keep the same unit system for all components.
  • Rounding too early: Small rounding changes can affect angles, projections, and near-perpendicular dot products.
  • Misreading a negative scalar: A negative scalar does not only change length; it also reverses the vector’s direction.

When to Use Vector Operations

Use vector operations when you need to:

  • Add or subtract movements, forces, velocities, or coordinate displacements.
  • Scale a vector without changing its basic component pattern.
  • Find the length of a vector from its components.
  • Determine whether two nonzero vectors are acute, obtuse, or perpendicular.
  • Find a perpendicular vector in 3D using the cross product.
  • Find how much of one vector points along another using projection.
  • Check 2D orientation using the signed cross value.

Limitations and Things to Keep in Mind

Vector calculations are only as meaningful as the coordinates you enter. If the coordinates come from measurements, drawings, simulations, or physical data, make sure they use a consistent coordinate system.

This calculator treats coordinates and scalars as unitless values. It does not convert units, check physical dimensions, or know whether your coordinates represent meters, feet, pixels, newtons, or another real-world quantity.

Blank, invalid, or non-finite entries are treated as zero rather than producing a separate input error. This is convenient for quick calculations, but it also means an accidental blank field can change the result.

The angle result requires two nonzero vectors. The projection of \(A\) onto \(B\) requires vector \(B\) to be nonzero. In 3D mode, results are numeric only; the graph preview is for 2D vectors.

Displayed numbers may be rounded. Ordinary values are shown with up to six decimal places, while very large or very small values may use significant-digit formatting. Values extremely close to zero may display as \(0\).

For coursework, engineering, physics, safety, or other important decisions, use the result as a calculation aid and double-check the setup, units, assumptions, and rounding.


How to Use This Calculator

  1. Choose 2D or 3D mode.
  2. Enter the coordinates for vector \(A\).
  3. Enter the coordinates for vector \(B\).
  4. Enter the scalar multiplier if you want to calculate the scalar multiple \(kA\).
  5. Review \(A + B\) as the main result.
  6. Compare the other results, including \(A - B\), \(kA\), dot product, cross result, magnitudes, angle, and projection of \(A\) on \(B\).
  7. In 2D mode, use the graph preview to see \(A\), \(B\), and \(A + B\).
  8. Use the example buttons for sample values, or clear the fields to start over.
  9. Download the 2D graph as a PNG when the graph download option is available.

Frequently Asked Questions

What does \(A + B\) mean?

\(A + B\) is the vector created by adding the matching components of \(A\) and \(B\). In movement terms, it represents the combined effect of following one vector and then the other.


Why is the angle unavailable for a zero vector?

A zero vector has length zero and no direction. Since an angle compares directions, the angle between a zero vector and another vector is undefined.


What does the dot product tell me?

The dot product is a scalar that combines both length and direction. For nonzero vectors, a positive dot product indicates an acute angle, zero indicates perpendicular vectors, and a negative value indicates an obtuse angle.


What is the difference between the 2D cross value and the 3D cross product?

In 3D, the cross product is a vector perpendicular to both input vectors. In 2D, the calculator shows the \(z\)-component that would result if the vectors were treated as lying in the \(xy\)-plane.


Why does projection onto \(B\) require \(B\) to be nonzero?

Projection onto \(B\) means finding the part of another vector that points in \(B\)’s direction. If \(B\) is the zero vector, it has no direction, so projection onto it is not defined.


Can I use negative coordinates or decimals?

Yes. Negative coordinates and decimal coordinates are valid vector components. A negative scalar is also valid, and it reverses the direction of \(A\) while scaling its length.


Sources and References

Books

  1. Jay Abramson et al. Precalculus 2e. OpenStax, 2021. Section 8.8, “Vectors.” https://openstax.org/books/precalculus-2e/pages/8-8-vectors
  2. Edwin Herman and Gilbert Strang. Calculus Volume 3. OpenStax, 2016. Chapter 2, Sections 2.1, 2.3, 2.4, and “Key Equations.” https://openstax.org/books/calculus-volume-3
  3. Samuel J. Ling, Jeff Sanny, and William Moebs. University Physics Volume 1. OpenStax, 2016. Chapter 2, Section 2.4, “Products of Vectors.” https://openstax.org/books/university-physics-volume-1/pages/2-4-products-of-vectors