Vector Calculator
Enter two vectors, in the plane or in space, and a scalar. The calculator gives the sum, the difference, the scalar multiple, the dot product, the cross product, the length of each vector, their unit vectors, the angle between them and the projection of A onto B. It also tells you when the vectors are perpendicular or parallel. Everything runs in your browser.
Write a vector as 1, 2, 3 or (1, 2, 3), with the numbers separated by commas, semicolons or spaces.
The dot product multiplies the matching components and adds them, so (1, 2, 3) . (4, 5, 6) is 4 + 10 + 18, which is 32. It is zero exactly when two non-zero vectors are perpendicular, and it gives the angle through cos(angle) = A . B / (|A| |B|). The cross product of two vectors in space is a vector perpendicular to both, with a length equal to the area of the parallelogram they span, and it changes sign when the order changes. In the plane there is no third direction, so the tool shows its z part, the single number a1 b2 - a2 b1. The unit vector has length 1 and points the same way, and the projection of A onto B is the part of A that lies along B. A zero vector has no direction, so its unit vector, angle and projection are not defined. Everything runs in your browser.
Related Tools
[5 suggestions]Distance and Midpoint Calculator: Between Two Points in 2D or 3D
Find the distance and the midpoint between two points in the plane or in space, with the exact radical form, the taxicab distance, and the other endpoint from a midpoint.
Student ToolsPythagorean Theorem Calculator
Find the missing side, angles, area and perimeter of a right triangle from any two values, and see whether the sides form a Pythagorean triple.
Student ToolsMatrix Calculator
Add, subtract and multiply matrices, and find the determinant, inverse, transpose, rank and row reduced form with exact fractions.
Student ToolsSlope Calculator
Find the slope, equation, intercepts, distance and midpoint of the line through two points, with exact fractions.
Student ToolsTriangle Calculator
Solve any triangle from three values (SSS, SAS, ASA, AAS or SSA) and get every side and angle, the area, perimeter, type and circle radii.
Student ToolsAbout the Vector Calculator
The dot product multiplies the matching components and adds them. For A = (1, 2, 3) and B = (4, 5, 6) it is 4 + 10 + 18, which is 32. The lengths are the square root of 14, about 3.7417, and the square root of 77, about 8.775, so the angle is the arccosine of 32 divided by their product, which is about 12.93 degrees. The sum is (5, 7, 9) and the difference is (-3, -3, -3). The cross product is (-3, 6, -3), a vector that is perpendicular to both A and B, and it changes sign when you swap the order. In the plane there is no third direction, so the tool shows the z part, the single number a1 b2 minus a2 b1. For (3, 4) and (4, -3) the dot product is 0, so the vectors are perpendicular, and the z part of the cross product is -25. The unit vector of (3, 4) is (0.6, 0.8). The projection of A onto B is the dot product divided by the squared length of B, times B, and for (3, 4) onto (1, 0) it is (3, 0). A zero vector has no direction, so its unit vector, angle and projection are not defined.
How do you calculate the dot product of two vectors?▾
Multiply the matching components and add the results. For (1, 2, 3) and (4, 5, 6) that is 1 times 4, plus 2 times 5, plus 3 times 6, which is 32. Two non-zero vectors are perpendicular exactly when the dot product is zero.
How do you find the angle between two vectors?▾
Divide the dot product by the product of the two lengths and take the arccosine. For (1, 2, 3) and (4, 5, 6), 32 divided by the square root of 14 times the square root of 77 is about 0.9746, so the angle is about 12.93 degrees.
What is the cross product?▾
In 3D it is a vector perpendicular to both inputs, with a length equal to the area of the parallelogram they span. For (1, 2, 3) and (4, 5, 6) it is (-3, 6, -3). Swapping the two vectors flips every sign.
Can I use two dimensions?▾
Yes. Choose 2D and the same results are shown, except that the cross product becomes one number, a1 times b2 minus a2 times b1, which is the signed area of the parallelogram.
Is my data uploaded?▾
No. The calculation runs in your browser and nothing you enter is sent anywhere.