How to Calculate the Scalar Product of Two Vectors

Video Lesson: How to Find the Scalar Product of Two Vectors

What is the Scalar Product?

The scalar product (dot product) of two vectors measures the extent to which their directions align. The result is a scalar quantity where the larger the value, the more aligned the vectors. A negative scalar product means that the vectors act in opposite directions.

The scalar product is often known as the dot product. The two terms can be used interchangeably.

The result of the scalar product calculation is a scalar quantity. This means that the final answer is just a single value.

The dot product represents how much one vector acts in the direction of another. The larger the result of the dot product calculation, the more aligned the two vectors are.

This is because the formula for the scalar product is given by a⋅b = ax bx + ay by.

ax and bx are the horizontal components of both vectors and ay and by are the vertical components of both vectors.

what the dot product represents

An alternative formula for the scalar product of a and b is given by:

a times b equals the absolute value of a times the absolute value of b cosine theta

The Scalar Product of a and b

Cosine is involved in the formula for the dot product as it tells us the projection of one vector onto the other.

Since the cosine of open paren 0 degrees close paren equals 1 and the cosine of open paren 90 degrees close paren equals 0, the angle between the two vectors directly impacts the size of the dot product.

If the angle between the two vectors is 0°, the vectors are parallel and the their scalar product is equal to the product of their magnitudes. That is a times b equals the absolute value of a times the absolute value of b.

  • Parallel vectors are most aligned in direction and therefore will have a larger scalar product than vectors of the same magnitude that are not parallel.
  • Perpendicular vectors act at 90° to one another. The scalar product of perpendicular vectors is equal to zero.

The dot product of two perpendicular vectors is always zero because the cosine of open paren 90 degrees close paren equals 0 and substituting this result into a times b equals the absolute value of a times the absolute value of b times cosine theta always results in zero.

The simplest way to test if two vectors are perpendicular is to calculate the dot product. The two vectors are perpendicular only if their dot product is equal to zero.

If vectors act at right angle to one another then one vector has no component acting in the same direction as the other vector. This is indicated by a dot product of zero.

It is possible to have a negative dot product. A negative dot product result means that the two vectors act partially in opposite directions.


The scalar product is also used to calculate the angle between two vectors using the formula:

cosine theta equals the fraction with numerator a times b and denominator the absolute value of a times the absolute value of b

The full lesson, video and worked examples of how to calculate the angle between two vectors can be found here.


The scalar product is commutative, which means that a⋅b = b⋅a. This is because a⋅b = |a||b|cosθ. The result of |a||b| = |b||a| and the angle θ between the two vectors remains the same.

For example, consider a equals 5 i plus 2 j and b equals 3 i plus 4 j.

a times b equals a sub x b sub x plus a sub y b sub y which becomes a times b equals 5 times 3 plus 2 times 4 equals 23.

b times a equals b sub x a sub x plus b sub y a sub y which becomes b times a equals 3 times 5 plus 4 times 2 equals 23.

The same values are multiplied together and then added. Since multiplication is commutative, so is the dot product.

the dot product is commutative

This process of finding the dot product does not involve the angle between two vectors.

To find the dot product without an angle, simply multiply the ‘i’ components, multiply the ‘j’ components and add the results.


The dot product of vectors is distributive, which means that a⋅(b + c) = a⋅b + a⋅c.

The distributive property of the dot product can be proven like so:

Consider the three vectors a, b and c where a equals a sub x i plus a sub y j, b equals b sub x i plus b sub y j and c equals c sub x i plus c sub y j.

The dot product of a and b is: a times b equals a sub x b sub x plus a sub y b sub y.

The dot product of a and c is: a times c equals a sub x c sub x plus a sub y c sub y.

Adding these two results, we obtain: a times b plus a times c equals a sub x b sub x plus a sub y b sub y plus a sub x c sub x plus a sub y c sub y.

We will refer back to this result later.

Now, when we add vectors b and c, we obtain: b plus c equals open paren b sub x plus c sub x close paren times i plus open paren b sub y plus c sub y close paren times j.

The dot product of a with (b + c) results in: a times open paren b plus c close paren equals a sub x times open paren b sub x plus c sub x close paren plus a sub y times open paren b sub y plus c sub y close paren.

Expanding this out we obtain: a times open paren b plus c close paren equals a sub x b sub x plus a sub y b sub y plus a sub x c sub x plus a sub y c sub y.

This is the same result as obtained previously for 1 lines Line 1: a times b plus a times c.

Therefore 1 lines Line 1: a times b plus a times c equals a times open paren b plus c close paren.


The dot product is used to indicate the strength of the alignment of two vectors of fixed magnitude. Therefore if the size of the vector is fixed, the larger the dot product, the more aligned the two vectors are.

In physics, the dot product has a real world application in finding the optimal angle for the positioning of solar panels in dynamic situations. The larger the dot product, the more aligned the direction of the panel is with the direction of the light from the sun.

Further applications of the scalar product include maximising or minimising the impact of the direction of a water current or wind on a given vehicle or object.

The dot product is often used in mathematics as a means to calculate the angle between two vectors.

Scalar Product of Two Vectors Formula

The formula for the scalar product is a⋅b = ∑ai bi. That is for 2D vectors: a = ax i + ay j and b = bx i + by j, the dot product is a⋅b = ax bx + ay by. For 3D vectors: a = ax i + ay j + az k and b = bx i + by j + bz k, the dot product a⋅b = ax bx + ay by + az bz.

a times b equals the sum from i equals 1 to n of a sub i b sub i

Formula for the Scalar Product of Two Vectors

In this formula, the sigma sign ‘Σ’ means to add up.

ai bi means to multiply the corresponding components of the two vectors together.

That is, multiply the numbers in the ‘i’ components together and add this result to the numbers in the ‘j’ components added together.


Formula for the Dot Product in 2 Dimensions

The formula for any two 2D vectors given as: a = ax i + ay j and b = bx i + by j, the dot product is a⋅b = ax bx + ay by.

The formula for the dot product of two vectors in 2D is:

a times b equals a sub x b sub x plus a sub y b sub y

The formula for the dot product in 2 dimensions
Scalar product formula for 2d vectors

For example, consider the vectors: a equals 3 i minus 2 j and b equals 4 i plus j.

  • a sub x equals 3
  • a sub y equals negative 2
  • b sub x equals 4
  • b sub y equals 1

Therefore the formula of a times b equals a sub x b sub x plus a sub y b sub y becomes a times b equals 3 times 4 positive negative 2 times 1 equals 12 minus 2 equals 10.

The dot product of the two vectors is equal to 10.


Formula for the Dot Product in 3 Dimensions

For any two 3D vectors given as: a = ax i + ay j + az k and b = bx i + by j + bz k, the dot product a⋅b = ax bx + ay by + az bz.

The formula for the dot product of two vectors in 3D is:

a times b equals a sub x b sub x plus a sub y b sub y plus a sub z b sub z

The formula for the dot product in 3 dimensions
scalar product formula for 3d vectors

For example, consider the two 3D vectors given as: a equals i plus 2 j plus 4 k and b equals 2 i minus j minus 3 k.

  • a sub x equals 1
  • a sub y equals 2
  • a sub z equals 4
  • b sub x equals 2
  • b sub y equals negative 1
  • b sub z equals negative 3

Therefore, the formula of a times b equals a sub x b sub x plus a sub y b sub y plus a sub z b sub z becomes:

a times b equals 1 times 2 plus 2 times negative 1 plus 4 times negative 3 equals 2 minus 2 minus 12 equals negative 12

The dot product of the two vectors equals -12.

How to Find the Scalar Product

To find the scalar product of two vectors, a = ax i + ay j + az k and b = bx i + by j + bz k, the dot product a⋅b = ax bx + ay by + az bz. In simple terms, multiply the numbers in the i components together, multiply the numbers in the j components together, multiply the numbers in the k components together then add the results.

For example, calculate the scalar product of a equals 2 i plus 3 j plus 5 k and b equals 3 i plus 10 j plus 2 k.

  1. We multiply the ‘i’ components so that 2×3 = 6.
  2. We multiply the ‘j’ components so that 3×10 = 30.
  3. We multiply the ‘k’ components so that 5×2 = 10.
  4. We add these results so that 6 + 30 + 10 = 46.

The scalar product of the two vectors equals 46.


For two vectors in 2D, the dot product is found by multiplying the corresponding ‘i’ components of the two vectors together, multiplying the corresponding ‘j’ components of the two vectors together and then adding the resuts.

How to find the scalar product

For example, find the dot product of a equals 3 i plus 2 j and b equals 5 i plus 4 j.

  1. Multiplying the ‘i’ components, we obtain 3 × 5 = 15.
  2. Multiplying the ‘j’ components, we obtain 2 × 4 = 8.
  3. Adding the two results together, we obtain the dot product as 15 + 8 = 23.
example of calculating the dot product

Here is another example of calculating the scalar product.

Calculate the scalar product of a = 4i – 3j and b = i + j.

  1. Multiplying the ‘i’ components, we obtain 4 × 1 = 4.
  2. Multiplying the ‘j’ components, we obtain -3 × 1 = -3.
  3. The scalar product is found by adding these results so that 4 – 3 = 1.

The scalar product of the two vectors equals 1.

how to calculate the dot product of two vectors

Calculating the Dot Product of 3D Vectors

For two 3D vectors: a = ax i + ay j + az k and b = bx i + by j + bz k, the dot product is given by a⋅b = ax bx + ay by + az bz. For example, if a = 2i + 4j + 3k and b = i – 2j + 5k, a⋅b = (2)×(1) + (4)×(-2) + (3)×(5) = 9.

Calculate the scalar product of a equals 2 i plus 4 j plus 3 k and b equals i minus 2 j plus 5 k.

  • a sub x equals 2
  • a sub y equals 4
  • a sub z equals 3
  • b sub x equals 1
  • b sub y equals negative 2
  • b sub z equals 5

Therefore, the formula a times b equals a sub x b sub x plus a sub y b sub y plus a sub z b sub z becomes:

a times b equals 2 times 1 plus 4 times negative 2 plus 3 times 5 equals 9

Therefore, the scalar product of the two vectors is equal to 9.

how to calculate the scalar product of two vectors in 3D

Scalar Product of Two Vectors Calculator

To use this scalar product calculator, enter the i, j and k components of vector A and vector B respectively. The calculator will automatically calculate the scalar product.

How to Find the Dot Product from their Magnitude and Angle

To calculate the dot product of two vectors when given their magnitudes ( |a| and |b| ) and the angle between them (θ), use the formula a⋅b=|a||b|cosθ.

a times b equals the absolute value of a times the absolute value of b times cosine theta

The scalar product of two vectors from an angle

For example, consider the vectors where vector a has a magnitude of |a| = 5 and vector b has a magnitude of |b| = 4.

The angle between the vectors is known to be θ = 60°.

To calculate the dot product of two vectors in this manner, their magnitudes and the angle between them must be known.

Therefore, the formula a times b equals the absolute value of a times the absolute value of b times cosine theta becomes a times b equals 5 times 2 times the cosine of open paren 60 degrees close paren.

the cosine of open paren 60 degrees close paren equals one half and so:

a times b equals 5 times 2 times one half equals 5.

The dot product of the two vectors is equal to 5.

Proof of the Scalar Product Rule

Consider the formula for the scalar product: a times b equals the absolute value of a times the absolute value of b times cosine theta.


The unit vector i has a modulus of 1.

The angle between the unit vector i and itself is 0°.

Therefore, the formula a times b equals the absolute value of a times the absolute value of b times cosine theta becomes i times i equals 1 times 1 times the cosine of open paren 0 degrees close paren. Evaluating this, we obtain i times i equals 1.

In a similar manner, j times j equals 1 and k times k equals 1.


The unit vector i and the unit vector j both has a modulus of 1.

These vectors are perpendicular to each other and so, the angle between them is 90°.

Therefore the formula a times b equals the absolute value of a times the absolute value of b times cosine theta becomes i times j equals 1 times 1 times the cosine of open paren 90 degrees close paren. Evaluating this, i times j equals 0.

In a similar manner, j times k equals 0 and i times k equals 0.


Now consider two vectors a equals a sub x i plus a sub y j plus a sub z k and b equals b sub x i plus b sub y j plus b sub z k.

Therefore, the dot product becomes a times b equals open paren a sub x i plus a sub y j plus a sub z k close paren times open paren b sub x i plus b sub y j plus b sub z k close paren.

Expanding this, we obtain:

a times b equals open paren a sub x i close paren times open paren b sub x i close paren plus open paren a sub x i close paren times open paren b sub y j close paren plus open paren a sub x i close paren times open paren b sub z k close paren plus open paren a sub y j close paren times open paren b sub x i close paren plus open paren a sub y j close paren times open paren b sub y j close paren plus open paren a sub y j close paren times open paren b sub z k close paren plus open paren a sub z k close paren times open paren b sub x i close paren plus open paren a sub z k close paren times open paren b sub y j close paren plus open paren a sub z k close paren times open paren b sub z k close paren.

This can be written by collecting the i, j and k unit vectors as so:

a times b equals open paren a sub x close paren times open paren b sub x close paren times i times i plus open paren a sub x close paren times open paren b sub y close paren times i times j plus open paren a sub x close paren times open paren b sub z close paren times i times k plus open paren a sub y close paren times open paren b sub x close paren times j times i plus open paren a sub y close paren times open paren b sub y close paren times j times j plus open paren a sub y close paren times open paren b sub z close paren times j times k plus open paren a sub z close paren times open paren b sub x close paren times k times i plus open paren a sub z close paren times open paren b sub y close paren times k times j plus open paren a sub z close paren times open paren b sub z close paren times k times k

Now we substitute the results from above. That is:

  • i times i equals 1, j times j equals 1 and k times k equals 1.
  • i times j equals 0, i times k equals 0, j times i equals 0, j times k equals 0, k times i equals 0 and k times j equals 0.

The formula simplifies to:

a times b equals open paren a sub x close paren times open paren b sub x close paren plus open paren a sub y close paren times open paren b sub y close paren plus open paren a sub z close paren times open paren b sub z close paren

We can write this as out final formula like so:

a times b equals a sub x b sub x plus a sub y b sub y plus a sub z b sub z

The dot (scalar) product always produces a scalar result by definition. The reason the dot product is always scalar is because all vector quantities are evaluated in the calculation. Parallel components such as i⋅i = 1, whereas perpendicular components such as i⋅j = 0.

The dot product is always a scalar quantity, whereas the cross product of vectors is used to obtain a vector quantity. The dot product is a measure of how aligned two vectors are, whereas the cross product describes a vector that is perpendicular to the two given vectors.