About the Dot Product Calculator
The dot product is the simplest way to compare two vectors. It multiplies matching components and adds the results, producing a single number that measures how much the vectors point in the same direction. From that number you can find the angle between them, test whether they are perpendicular and project one vector onto another.
This calculator accepts vectors with any number of components, as long as both have the same length. It shows the component products, their sum, both magnitudes, the angle in degrees and the scalar and vector projection of the first vector onto the second. If one vector is the zero vector, it explains why the angle cannot be defined.
What is the dot product?
The dot product, or scalar product, of and is . Unlike the cross product, the result is a number, not a vector.
Geometrically, , where is the angle between the vectors. The dot product is positive when the angle is acute, zero when the vectors are perpendicular and negative when the angle is obtuse.
How to use the Dot Product Calculator
- Enter the components of the first vector separated by commas, for example 1, 2, 3.
- Enter the second vector with the same number of components.
- Press Calculate.
- Read the dot product, the magnitudes and the angle between the vectors.
- Use the projection step if you need the component of one vector along the other.
Formulas
Dot product
Magnitude
Angle between vectors
Projection of u onto v
Worked example: ⟨1,2,3⟩ · ⟨4,−5,6⟩
The example uses and . The component products are 4, and 18, which add to 12.
The magnitudes are and , so and the angle is about . The positive dot product confirms that the angle is acute.
The solution below is generated by the same engine that powers the calculator above.
Final answer
How we read your problem
Dot product of two 3-dimensional vectors.
Step-by-step solution
Multiply matching components
Add the products
Find the magnitudes
Angle between the vectors
Scalar and vector projection of u onto v
Formulas used
Dot product
The dot product is positive, so the angle between the vectors is acute.
Verification
- Computed exactly; the dot product is symmetric, so v·u gives the same value.
Detailed explanation
Measuring angles and perpendicularity
Rearranging the geometric formula gives the angle between any two nonzero vectors. Because only the sign of decides whether an angle is acute or obtuse, the sign of the dot product alone tells you which it is, before you compute any magnitudes.
Two vectors are orthogonal exactly when their dot product is zero. For and the dot product is 0 and the angle is . This test works in any dimension, which is why orthogonality is defined through the dot product in four or more dimensions, where angles cannot be drawn.
Projections
The scalar projection is the signed length of the shadow that casts on the line through . The vector projection multiplies the unit vector in the direction of by that length. Subtracting the projection from leaves the component perpendicular to , the idea behind the Gram-Schmidt process and least-squares fitting.
In physics, the work done by a constant force moving an object along a displacement is : only the component of the force along the motion does work.
Properties
The dot product is commutative, , and distributes over addition. The dot product of a vector with itself is the square of its length, which is how magnitudes are computed. Scaling one vector by scales the dot product by but leaves the angle unchanged when is positive.
The dot product also connects to the law of cosines. Expanding gives , which is exactly the law of cosines for the triangle formed by the two vectors and their difference. That identity is the reason the angle formula works.
Common mistakes
- Expecting a vector as the answer; the dot product is a single number.
- Multiplying mismatched components or vectors of different lengths.
- Forgetting to take the square root when computing magnitudes.
- Leaving a calculator in radians when the angle is wanted in degrees.
- Projecting onto the wrong vector; and differ.
Tips
- Check orthogonality first: a zero dot product means a right angle.
- Use the sign of the dot product to predict whether the angle is acute or obtuse.
- Normalise vectors to length 1 first and the dot product equals directly.
- Use the cross product calculator when you need a vector perpendicular to both.
- Use the matrix calculator to compute many dot products at once as a matrix product.
- Write each vector as a column next to the other so matching components line up before you multiply.
Frequently asked questions
How do you calculate the dot product?
Multiply the matching components of the two vectors and add the products. For ⟨1, 2, 3⟩ and ⟨4, −5, 6⟩ this gives 4 − 10 + 18 = 12.
How do I find the angle between two vectors?
Divide the dot product by the product of the magnitudes and take the inverse cosine. The calculator shows this in degrees.
What does a dot product of zero mean?
The vectors are perpendicular (orthogonal), provided neither is the zero vector.
Can the dot product be negative?
Yes. A negative dot product means the angle between the vectors is greater than 90°.
Does the calculator work in more than three dimensions?
Yes. Vectors can have any number of components, as long as both vectors have the same number.
What is the difference between the dot product and the cross product?
The dot product gives a number that measures alignment and works in any dimension. The cross product gives a vector perpendicular to both inputs and is defined for three-dimensional vectors.
What happens if one vector is zero?
The dot product is 0, but the angle is undefined because the zero vector has no direction. The calculator states this instead of giving an angle.
Compute your dot product
Enter two vectors above to get their dot product, the angle between them and the projection.