Vector Calculator

Perform 2D and 3D vector operations: addition, subtraction, dot product, cross product, magnitude, and angle between vectors.

Dimensions:

Vector A

Vector B

x

5

y

7

z

9

How to Use the Vector Calculator

  1. Choose 2D or 3D. Two-dimensional vectors have x and y components. Three-dimensional vectors have x, y, and z. Select the dimension that matches your problem.
  2. Select an operation. Add and subtract combine corresponding components. Dot product gives a scalar showing how parallel two vectors are. Cross product (3D only) gives a vector perpendicular to both inputs. Magnitude gives the vector length. Unit vector normalizes A to length 1. Angle gives the angle between two vectors in degrees.
  3. Enter vector components. Type each component into the labeled fields. Results update instantly as you type.

Example: A = (1, 2, 3) and B = (4, 5, 6). Dot product = 1×4 + 2×5 + 3×6 = 4+10+18 = 32. Angle = arccos(32 / (√14 × √77)) = arccos(32/32.83) ≈ 12.93 degrees.

Vector Operation Formulas

For vectors A=(a₁,a₂,a₃) and B=(b₁,b₂,b₃):

Addition:      A + B = (a₁+b₁, a₂+b₂, a₃+b₃)
Subtraction:   A - B = (a₁-b₁, a₂-b₂, a₃-b₃)

Magnitude:     |A| = √(a₁² + a₂² + a₃²)
               Example: |(1,2,3)| = √(1+4+9) = √14 ≈ 3.7417

Unit vector:   Â = A / |A| = (a₁/|A|, a₂/|A|, a₃/|A|)
               Always has magnitude 1.

Dot product:   A·B = a₁b₁ + a₂b₂ + a₃b₃
               Also: A·B = |A||B|cos(θ)
               Example: (1,2,3)·(4,5,6) = 4+10+18 = 32

Cross product (3D only):
  A×B = (a₂b₃-a₃b₂, a₃b₁-a₁b₃, a₁b₂-a₂b₁)
  Example: (1,0,0)×(0,1,0) = (0,1,0 - 0,0,0 - 1,0,0) = (0,0,1)
  |A×B| = |A||B|sin(θ)  (area of parallelogram)

Angle between vectors:
  θ = arccos(A·B / (|A||B|))
  θ = 0° if parallel, 90° if perpendicular, 180° if antiparallel
  (1,2,3) and (4,5,6): θ = arccos(32/√(14×77)) ≈ 12.93°

Frequently Asked Questions

The dot product of two vectors produces a scalar (a single number). It equals |A||B|cos(θ), where θ is the angle between them. It is zero when the vectors are perpendicular. It is maximum when they point in the same direction. Uses: finding angles, projecting one vector onto another, computing work done by a force (W = F·d). The cross product (3D only) produces a new vector perpendicular to both inputs. Its magnitude equals |A||B|sin(θ), the area of the parallelogram formed by A and B. Uses: finding surface normals, computing torque, and determining orientation.

Related Calculators