Skip to content
ToolBoxGeniehome

Vector Calculator

Calculators · Added

Enter two vectors in two or three dimensions and get every standard operation at once — sum, difference, dot and cross products, magnitudes, unit vectors, the angle between them and the projection of one onto the other, each with a note on what it means.

Dimensions
Vector A
Vector B
Try:

How to use the vector calculator

  1. 1Choose two or three dimensions.
  2. 2Enter the components of each vector.
  3. 3Read the results — dot and cross products, magnitudes, angle and projection are all computed together.
  4. 4Check the notes for what a zero dot product or a zero cross product is telling you.

Examples

A 2D pair

Input
A = (3, 4), B = (1, 0)
Result
Dot 3, cross magnitude 4 with the z-component negative, |A| = 5, angle 53.13°, projection of A onto B is (3, 0), distance between the tips 4.472.

The negative cross component says B turns clockwise to reach A.

A 3D cross product

Input
A = (1, 2, 3), B = (4, 5, 6)
Result
A × B = (−3, 6, −3), dot 32, angle 12.93°, cross magnitude 7.348 — the area of the parallelogram they span.

About the vector calculator

Two products, two different questions

The dot product answers 'how aligned are these?' and returns a plain number. The cross product answers 'what plane do these span, and how much of it?' and returns a vector perpendicular to both, whose length is the area of the parallelogram they make.

One immediate consequence is that the cross product is not commutative: swapping the inputs reverses the result, because the right-hand rule that fixes its direction depends on the order. The dot product is symmetric and does not care. Both facts drop straight out of the geometry rather than being conventions to memorise.

The two degenerate cases

A dot product of zero means the vectors are perpendicular. A cross product of zero means they are parallel or antiparallel — pointing along the same line, and spanning no area at all. Those two conditions between them cover most of what you actually want to test about a pair of vectors, and both are exact checks rather than comparisons against a threshold.

There is a third degenerate case worth naming: the zero vector. It has no direction, so the angle between it and anything else is undefined, and normalising it is a division by zero. This page reports that rather than returning a plausible-looking number, which is the failure mode that tends to survive into production code.

Frequently asked questions

What does the dot product actually measure?
How much of one vector points along the other, scaled by both lengths. It is positive when they broadly agree in direction, negative when they broadly oppose, and exactly zero when they are perpendicular — which makes it the standard test for a right angle. In physics it is what turns a force and a displacement into work done.
Why is the cross product only defined in three dimensions?
Because it returns a vector perpendicular to both inputs, and in two dimensions there is no such direction within the plane. Feed it a 2D pair and the result points out of the plane along z, so only that component is non-zero — which is still useful, since its sign tells you which way one vector turns to reach the other. Genuine cross products need three dimensions.
What is the projection for?
It splits one vector into the part that lies along another and the part perpendicular to it. That decomposition is everywhere: the component of gravity acting down a slope, the part of a velocity that carries a body towards a target, the shadow one direction casts on another. The perpendicular remainder is shown alongside, since the two together reconstruct the original.
How is the angle computed?
From the cross and dot products together, using a two-argument arctangent, rather than from the more familiar arccosine of the dot product over the magnitudes. Both are correct on paper. The arccosine form loses precision badly for nearly parallel vectors, where its argument sits close to one and small rounding errors turn into visible angle errors, and this route does not have that weakness.