Advanced maths

Vector operations calculator

Calculate sums, dot and cross products, lengths, angles and projections in one place.

Your numbers

Enter 2 or 3 rational components, separated by spaces or commas. No brackets.
Use the same number of components as A. Integers, decimals up to 6 places and fractions such as 1/3 are supported.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your numbers and select Calculate.

Behind the numbers

How this calculation works

The dot product combines matching components into a scalar. The cross product is a 3D perpendicular vector; two-component inputs use z = 0. Projection resolves A along the direction of B. The angle uses the dot and cross products, and is undefined if either vector is zero.

THE FORMULAA · B = Σ AᵢBᵢ; proj_B(A) = [(A · B)/(B · B)] B

A worked example

For A = (1,2,3) and B = (4,5,6), A · B = 32 and A × B = (−3,6,−3).

Good to know

Flat Cartesian coordinates with matching units. Each component is between −1,000,000 and 1,000,000; decimal inputs allow up to 6 places and integer fractions have denominators up to 1,000,000. Expressions are not parsed. Exact intermediate fractions have a size limit; reduce unusually complex inputs if that limit is reached. Lengths and angles are decimal approximations.

A little curiosity

Different products answer different questions

The dot product produces one number. It measures how strongly two directions align, with both vector lengths included. A positive value indicates an acute angle for nonzero vectors, zero indicates perpendicular directions, and a negative value indicates an obtuse angle.

The cross product produces a perpendicular vector in three dimensions. Reversing the input order reverses its sign. For (1,0,0) crossed with (0,1,0), the result is (0,0,1); reversing the inputs gives (0,0,−1). That order matters in orientation and torque calculations.

Two-component inputs are placed in the xy plane by assigning z = 0. Their 3D cross product therefore points along the z axis. The reported cross product is not an entry-by-entry multiplication.

Projection separates an along-direction part from a remainder

Projecting A onto B gives the component of A along the line spanned by B. Subtracting that projection from A gives the rejection, which is perpendicular to B. For A = (3,4) and B = (1,0), the projection is (3,0) and the rejection is (0,4).

Scaling B by a nonzero factor changes its length but not the projection onto its line. Swapping A and B does change the question: the vector being resolved and the target direction have exchanged roles.

A zero vector still has valid sums, differences, dot products and cross products. It has no direction, so an angle involving it is undefined. Projection onto a zero B is undefined as well. The tool keeps the defined results visible and identifies those exceptions separately.

A few questions, answered

Are the components exact?

Accepted integers, finite decimals and fractions are processed as exact rational values for algebraic outputs. Lengths and angles use decimal approximations.

Can I mix a 2D and a 3D vector?

Use the same number of components in both fields. Add an explicit zero third component if you want a 2D direction represented in 3D.

What angle is shown?

The smaller unsigned angle between two nonzero vectors, from 0° through 180°. It is not a signed planar heading or bearing.

Find your calculator

Start typing to explore the library.