Scalar product or dot product

The Scalar Product, also known as the Dot Product, is a mathematical operation that takes two vectors and returns a scalar (single value) result. 

The Dot Product is defined as:

A.B = ||A|| * ||B|| * cos(θ)

Where:
A and B are the two vectors
||A|| and ||B|| represent the magnitude (length) of the vectors A and B
θ is the angle between the two vectors A and B

To calculate the Dot Product step by step:

  • Calculate the magnitudes of the two vectors: ||A|| and ||B||.
  • Calculate the angle between the two vectors, θ.
  • Multiply the magnitudes of the two vectors: ||A|| * ||B||.
  • Multiply the result of step 3 by the cosine of the angle between the vectors, θ.
  • The result of step 4 is the Dot Product of the two vectors.