Vector Calculator
Choose two or three dimensions and enter the components of vectors A and B. Every common vector result is shown at once.
Worked examples
Dot and cross product
A = (1, 2, 3), B = (4, 5, 6)
Dot 32, cross (-3, 6, -3)
1×4 + 2×5 + 3×6 = 32.
Angle between them
A = (1, 2, 3), B = (4, 5, 6)
12.93 degrees
cos θ = 32 ÷ (√14 × √77).
About Vector Calculator
A vector has a size and a direction, and is written as a list of components, such as (1, 2, 3). Adding or subtracting two vectors works one component at a time. The magnitude, or length, is the square root of the sum of the squares of the components, and a unit vector points the same way but has length 1, found by dividing each component by the magnitude. Vectors are used for forces, velocities, positions and directions in physics, engineering and graphics.
The dot product multiplies matching components and adds the results to give a single number. It is zero when the vectors are at right angles, and it gives the angle between them, because the cosine of the angle is the dot product divided by the product of the lengths. The cross product of two 3D vectors is a new vector at right angles to both, and its length is the area of the parallelogram they make. This page works out all of these at once for two or three dimensions, plus the projection of one vector onto the other.
How to use Vector Calculator
- Choose two or three dimensions.
- Enter the components of vector A.
- Enter the components of vector B.
- Read the dot product, lengths and angle, and the table of other results below.
Common uses
- Physics homework on forces and work done
- Finding the angle between two directions
- Checking whether two lines are at right angles
- Computer graphics and game maths
Frequently asked questions
What does a dot product of zero mean?
The vectors are at right angles to each other, as long as neither is the zero vector.
What is the cross product used for?
It gives a vector perpendicular to the plane of two vectors, which is how you find the normal to a surface. Its length is the area of the parallelogram the two vectors span.
Why is there no cross product in two dimensions?
The result would point out of the page, in the third dimension. In 2D this page shows the single z value, which is also the signed area of the parallelogram.
How do I find the angle between two vectors?
Work out the dot product and divide by the product of the two lengths. That is the cosine of the angle, and the inverse cosine gives the angle. The page does this for you.
What is a unit vector?
A vector of length 1 in the same direction. It is useful for describing direction without any size.