Toolstia / Vector calculator

Vector calculator

Enter two vectors and see everything at once: sum, difference, dot product, cross product, lengths, unit vectors, the angle between them and the projection of one on the other. It works with 2, 3 or 4 components.

Works with 2, 3 or 4 components. The cross product exists in three dimensions, and for two dimensions the tool gives its z part. Both vectors need the same number of components.

How it works

  1. Type vector A and vector B, with components separated by commas.
  2. Read the table of results.
  3. Change a component to see how everything updates.

Dot product

Multiply matching components and add them up. It is zero when the vectors are at right angles.

Cross product

In three dimensions it gives a new vector perpendicular to both. Its length is the area of the parallelogram they span. In two dimensions the tool gives the single z component.

Angle

The angle between the vectors in degrees, from 0 to 180. It is undefined if either vector is the zero vector.

Projection

How much of A points along B, shown as a length and as a vector.

Questions

Do both vectors need the same size?

Yes. Both need the same number of components. Everything happens in your browser, and nothing you enter is sent anywhere.

Can I use spaces instead of commas?

Yes. Commas, spaces and semicolons all work.

Why is there no cross product for 4D?

The cross product only exists in 3D, with a 2D version that gives one number.