Category

Dot Product Calculator — Scalar Product of Two Vectors and the Angle Between Them

Compute the dot product a · b of two 2D or 3D vectors using a·b = a_x·b_x + a_y·b_y + a_z·b_z. Returns the scalar product, the magnitudes |a| and |b|, the cosine of the angle, and the angle between the vectors in degrees and radians, with a step-by-step solution. Supports metric (mm, cm, m, km) and US/Imperial (in, ft, yd, mi) units.

0 calculations

Calculator Parameters

Enter Vector Components

Enter the components of vectors a and b to compute their dot product a · b.

The vector dot product calculator comes in handy when you are solving vector multiplication problems. Instead of calculating the scalar product by hand, you can simply input the components of two vectors into this tool and let it do the math for you.

Please keep reading to learn the dot product formula our calculator uses, how to estimate the dot product of two vectors, and how to generalize the formula for the matrix dot product. Together with the cross product calculator, you'll learn that vector algebra isn't anything to worry about!

Vector multiplication types

There are two main types of vector multiplication: the dot product (also called the scalar product), denoted with the symbol "·", and the cross product (also known as the vector product), indicated with the symbol "×". The main difference is that the product of the dot operation is a single number, while the outcome of the cross operation is a vector.

What is the dot product formula?

Let's assume that we will perform all our calculations in 3D space. That means that every vector can be written down using three components:

a = [a1, a2, a3]
b = [b1, b2, b3]

Geometrically, the dot product is described as the product of the vectors' magnitudes multiplied by the cosine of the angle between them. We can express this using the equation:

a⋅b = |a| × |b| × cos α

You can probably notice that if the angle between two vectors is equal to 90°, then the scalar product will always be equal to 0, regardless of the vectors' magnitudes. Similarly, if the angle is equal to 0° (the vectors are collinear), the dot product is found by multiplying the magnitudes only. In other words, the bigger the relative slope between two vectors, the higher the dot product value.

Algebraically, the dot product is the sum of the products of the vectors' components. For three-component vectors, the dot product formula looks as follows:

a⋅b = a1b1 + a2b2 + a3b3

In a space that has more than three dimensions, you simply need to add more terms to the summation. If, on the other hand, you want to multiply vectors in a 2D space, you have to omit the third term of the formula.

The dot product calculator can also work as a tool to find the angle between two vectors for which cosine is the ratio between the scalar product and the vectors' magnitudes:

cos α = a⋅b / (|a| × |b|)

Determining the vector dot product

So, how does our vector multiplication calculator work? Follow this step-by-step example to get a better understanding of the principle behind this process.

  1. Choose your vector a. For example, we will take a = [4, 5, −3].
  2. Choose your vector b. Let's assume it is equal to b = [1, −2, −2].
  3. Calculate the product of the first component of each vector: 4 × 1 = 4.
  4. Calculate the product of the second (middle) component of each vector: 5 × (−2) = −10.
  5. Calculate the product of the third component of each vector: (−3) × (−2) = 6.
  6. Add all of these results together to find the dot product: 4 + (−10) + 6 = 0.

The result is 0. This outcome is the scalar product of these two vectors. This means that they are perpendicular to each other (the angle between them is equal to 90°).

Scalar product in spherical coordinates

It is also possible to calculate the scalar product of two vectors if they are written in spherical coordinates. To deal with the challenge, we need to express our new coordinates with the radius r and two angles θ, φ:

x1 = r1 × sin φ1 × cos θ1
y1 = r1 × sin φ1 × sin θ1
z1 = r1 × cos φ1

And analogically for x2, y2, z2. Using the equation for the cosine of the angles' difference, the formula simplifies to:

a⋅b = r1 × r2 × (sin φ1 × sin φ2 × cos(θ1−θ2) + cos φ1 × cos φ2)

Matrix dot product

The idea of "multiplying things component by component and summing" generalizes to matrices. When you multiply two matrices, each entry of the result is exactly the dot product of a row from the first matrix with a column from the second one. So the dot product is the fundamental building block of matrix multiplication: master the vector case here, and the matrix case follows naturally.

The dot product of two vectors — graphical interpretation

Geometrically, a⋅b measures how much two vectors point in the same direction. If you project vector a onto vector b, the dot product equals the length of that projection multiplied by |b|. A positive dot product means the vectors form an acute angle (they broadly agree in direction); a negative value means an obtuse angle (they broadly oppose); and zero means they are exactly perpendicular.

Triple product — how to calculate the volume of a parallelepiped?

Combining both products gives the scalar triple product a⋅(b × c). Its absolute value equals the volume of the parallelepiped whose edges are the three vectors a, b, and c. If the triple product is zero, the three vectors are coplanar and enclose no volume.

Applications of dot product

  • Work in physics: the work done by a force is W = F⋅d, the dot product of force and displacement.
  • Finding angles: rearranging the geometric formula gives the angle between any two vectors.
  • Testing perpendicularity: two vectors are orthogonal exactly when their dot product is zero.
  • Projections: the dot product is the heart of the vector projection formula.
  • Computer graphics & machine learning: lighting, similarity scores, and cosine similarity all rely on the dot product.

How to use the dot product calculator

  1. Pick your unit system — metric (mm, cm, m, km) or US/Imperial (in, ft, yd, mi). The choice only affects how the components are labelled.
  2. Choose the dimension — 2D (x, y) or 3D (x, y, z).
  3. Enter the components of vector a and vector b.
  4. Read off the dot product a⋅b, the magnitudes |a| and |b|, the cosine of the angle, the angle between the vectors in degrees and radians, and a step-by-step solution.

FAQs

What is the dot product of two vectors?
It is a single number (a scalar) equal to axbx + ayby + azbz, or equivalently |a|·|b|·cos α.
What does a dot product of zero mean?
The two vectors are perpendicular (orthogonal) — the angle between them is 90°.
Is the dot product commutative?
Yes. a⋅b = b⋅a, unlike the cross product, which is anti-commutative.
What is the difference between the dot product and the cross product?
The dot product returns a scalar and measures parallelism (|a|·|b|·cos θ); the cross product returns a perpendicular vector and measures perpendicularity (|a|·|b|·sin θ).
Can I take the dot product in more than three dimensions?
Yes. The dot product is defined in any number of dimensions — just add one product term per component. The cross product, by contrast, is special to 3D.

Calculation History

Loading...