Math

Vector Calculator

Calculate the dot product, cross product, magnitude, and angle between two vectors, with a live animated diagram.

Did this calculator help you?

What is Vector Calculator?

A vector calculator performs the fundamental operations of vector algebra: the dot product, cross product, magnitude, and the angle between two vectors. Vectors describe quantities that have both magnitude and direction — velocity, force, displacement, and acceleration are all vectors — which makes vector math essential to physics, engineering, 3D graphics, robotics, and machine learning. The dot product measures how aligned two vectors are and is used to calculate work done by a force or to test perpendicularity. The cross product produces a vector perpendicular to both inputs and is used to find torque, angular momentum, and surface normals in 3D graphics. This calculator computes all of these instantly and draws an animated 2D diagram of your vectors so you can see the geometry, not just the numbers.

When to Use This Calculator

  • You're solving a physics problem involving force, velocity, or displacement vectors and need the dot or cross product
  • You're computing the angle between two vectors for a linear algebra assignment
  • You need to find a surface normal vector for a 3D graphics or game development project
  • You're calculating torque or angular momentum in an engineering problem
  • You're verifying vector calculations by hand and want to check your work
  • You're working on robotics or computer vision algorithms that require vector operations

Steps:

  1. Enter the x, y, and z components of Vector A.
  2. Enter the x, y, and z components of Vector B (leave z at 0 for 2D vectors).
  3. View the dot product, cross product, magnitude of each vector, and the angle between them instantly.
  4. Watch the animated diagram redraw to show how the two vectors point relative to each other.

Formula

Dot Product: A·B = AxBx + AyBy + AzBz Cross Product: A×B = (AyBz − AzBy, AzBx − AxBz, AxBy − AyBx) Magnitude: |A| = √(Ax² + Ay² + Az²) Angle: θ = arccos( (A·B) / (|A|·|B|) )

Use Cases

  • Calculating work done by a force using the dot product in physics problems
  • Finding surface normals for lighting calculations in 3D computer graphics
  • Computing torque and angular momentum in mechanical engineering
  • Determining whether two vectors are perpendicular or parallel in linear algebra coursework
  • Robotics and game development calculations involving direction and orientation

Key Benefits

  • Instant dot product, cross product, magnitude, and angle in one place
  • Animated diagram shows the geometric relationship, not just numbers
  • Works for both 2D vectors (z = 0) and full 3D vectors
  • No manual trigonometry or square-root calculations required

Pro Tips

  • A dot product of zero instantly tells you the vectors are perpendicular — no need to compute the angle
  • A cross product of the zero vector tells you the two vectors are parallel (or one is zero)
  • For 2D problems, just leave z at 0 — the formulas still work correctly
  • Use the right-hand rule to predict the cross product's direction before checking the calculated result

Common Mistakes to Avoid

  • Confusing the dot product (a scalar) with the cross product (a vector)
  • Forgetting the cross product only applies to 3D vectors, not 2D
  • Using degrees vs. radians inconsistently when computing the angle by hand
  • Assuming a zero cross product means the vectors are unrelated, when it actually means they're parallel

Key Terms Explained

Scalar: A single number with magnitude but no direction, like the dot product result
Magnitude: The length of a vector, calculated with the Pythagorean theorem
Orthogonal: Another word for perpendicular, used when the dot product is zero
Right-hand rule: A convention for determining the direction of a cross product

Related Concepts

  • Dot Product (Scalar Product): A scalar result equal to the product of two vectors' magnitudes and the cosine of the angle between them, measuring how aligned they are
  • Cross Product (Vector Product): A vector perpendicular to both input vectors, with magnitude equal to the area of the parallelogram they span
  • Magnitude (Norm): The length of a vector, computed as the square root of the sum of its squared components
  • Orthogonal Vectors: Two vectors whose dot product is zero, meaning they are perpendicular to each other
  • Right-Hand Rule: A convention for determining the direction of a cross product: curl fingers from A to B, thumb points in the direction of A×B

Example

For A = (3, 2, 0) and B = (1, 4, 0): the dot product is 3×1 + 2×4 = 11, the magnitude of A is √13 ≈ 3.61, the magnitude of B is √17 ≈ 4.12, and the angle between them is about 42°.

Interpreting Your Results

The calculator computes four key vector properties simultaneously: the dot product (a scalar measuring alignment), the cross product (a vector perpendicular to both inputs), the magnitude of each vector, and the angle between them. The dot product tells you how much two vectors point in the same direction — a positive value means they're generally aligned, zero means they're perpendicular, and negative means they're generally opposite. The cross product magnitude equals the area of the parallelogram formed by the two vectors, and its direction follows the right-hand rule. If the cross product is the zero vector, the input vectors are parallel (or one is zero). The angle is computed from the dot product formula: cos(θ) = (A·B) / (|A|·|B|), then taking the inverse cosine. The animated diagram draws both vectors from the origin in the x-y plane (for 2D) or projected onto the x-y plane (for 3D). Use it to visually confirm that the computed angle and magnitudes make sense — if the diagram shows vectors at roughly 90° but the angle result says 85°, something may be off with your input values.

Frequently Asked Questions

What's the difference between dot product and cross product?
The dot product returns a single scalar number representing how much two vectors point in the same direction — it's zero when they're perpendicular. The cross product returns a new vector perpendicular to both inputs, with a magnitude equal to the area of the parallelogram they form.
How do you find the angle between two vectors?
Divide the dot product of the two vectors by the product of their magnitudes, then take the inverse cosine (arccos) of that ratio. The result is the angle between them in degrees or radians.
What does it mean when the dot product is zero?
A dot product of zero means the two vectors are perpendicular (orthogonal) to each other — there is no component of one vector in the direction of the other.
Can I use this calculator for 2D vectors?
Yes. Simply leave the z-component at 0 for both vectors and the calculator behaves exactly like a 2D vector calculator, including the diagram, which is always drawn in the x-y plane.
What's the geometric meaning of the dot product?
Geometrically, A·B = |A|·|B|·cos(θ). It equals the magnitude of A times the projection of B onto A (or vice versa). If you imagine shining a light perpendicular to A, the dot product tells you how much of B's shadow falls along A. A positive value means B has a component in A's direction; zero means they're perpendicular.
Why is the cross product only defined in 3D?
The cross product produces a vector perpendicular to both inputs, which requires three dimensions to exist. In 2D, there's no third dimension for the result to point into. For 2D problems, you can compute the scalar z-component of the cross product (Ax·By - Ay·Bx), which is a single number rather than a vector.
What does it mean when two vectors are parallel?
Parallel vectors point in the same or exactly opposite direction. Their cross product is the zero vector, and the angle between them is 0° (same direction) or 180° (opposite direction). Their dot product equals the product of their magnitudes (or its negative for opposite directions).
Can I use this for force or velocity calculations?
Yes. Force and velocity are both vectors. Use the dot product to calculate work done by a force (W = F·d), and the cross product to find torque (τ = r×F). For velocity, the dot product with a displacement vector gives the component of velocity along that direction.
What's the relationship between the cross product area and a triangle?
The magnitude of the cross product A×B equals the area of the parallelogram spanned by A and B. Half of that magnitude equals the area of the triangle formed by A and B. This provides an alternative way to compute triangle area when you know two sides as vectors.
How do I interpret a negative dot product?
A negative dot product means the angle between the vectors is greater than 90° — they're pointing in generally opposite directions. The more negative the value (relative to the product of magnitudes), the closer the vectors are to pointing in exactly opposite directions (approaching 180°).
What's the difference between a vector and a scalar?
A scalar is a single number with magnitude only (like temperature or mass). A vector has both magnitude and direction (like force or velocity). The dot product converts two vectors into a scalar, while the cross product converts two vectors into another vector.

Discover More Tools

Fresh picks from across our tool library.