| Table of contents | |
| Algebraic identities and useful results | |
| Engineering applications | |
| Practical notes and numerical considerations | |
| Summary |
The dot product (also called the scalar product or inner product in Euclidean space) is a scalar quantity that describes the angular and magnitude relationship between two vectors. This article explains how to compute the dot product, its geometric meaning, common algebraic identities, methods to obtain angles and projections from it, and engineering applications relevant to mechanics and structural problems.
Let two vectors A and B each have n components: A = (A1, A2, ..., An) and B = (B1, B2, ..., Bn).
The dot product A · B is the scalar
A · B = A1B1 + A2B2 + ... + AnBn
For three-dimensional vectors A = (Ax, Ay, Az) and B = (Bx, By, Bz) this becomes
A · B = AxBx + AyBy + AzBz
A simple implementation in C++ for floating-point arrays of length size is:
float dot_product(const float *a, const float *b, int size) { float dp = 0.0f; for (int i = 0; i < size; i++) dp += a[i] * b[i]; return dp; }
This code is a generic illustration. In many development libraries (for example graphics or numerical libraries) specialised and optimised functions exist for 2D, 3D and 4D vector types.

If |A| and |B| denote the magnitudes (lengths) of vectors A and B respectively, and Θ is the angle between them, then
A · B = |A| |B| cos(Θ)
This identity links an algebraic computation (sum of componentwise products) to the geometry (angle and lengths).
For unit vectors (vectors with magnitude 1) the dot product directly gives the cosine of the angle between them.
If |A| = |B| = 1, then A · B = cos(Θ) and Θ = acos(A · B)
For non-unit vectors, the angle may be found by normalising or by dividing the dot product by the product of magnitudes:
cos(Θ) = (A · B) / (|A| |B|) ⇒ Θ = acos( (A · B) / (|A| |B|) )
The dot product of a vector with itself equals the square of its magnitude:
A · A = |A|2 = Ax2 + Ay2 + Az2
The scalar projection (component) of B on A is the signed length of the shadow of B along A. The vector projection gives the vector component of B in the direction of A.
Scalar projection of B on A (also called the component of B along A):
compA(B) = (A · B) / |A|
Vector projection of B onto A:
projA(B) = [(A · B) / |A|2] A
When A is a unit vector û, the scalar projection simplifies to û · B and the vector projection is (û · B) û.
Find the angle between vectors A = (2, -1, 2) and B = (1, 0, 2).
Sol.
A · B = 2×1 + (-1)×0 + 2×2
|A| = sqrt(22 + (-1)2 + 22)
|B| = sqrt(12 + 02 + 22)
cos(Θ) = (A · B) / (|A| |B|)
Θ = acos( (A · B) / (|A| |B|) )
Numerical substitution gives the required angle (calculator may be used for the final arccos evaluation).
The dot product is a fundamental scalar operation that connects algebraic componentwise multiplication with geometric quantities - lengths and the cosine of the angle between vectors. It is central to mechanics and engineering analyses for calculating work, resolving forces, projecting vectors, and testing orthogonality. Mastery of dot product algebra, geometric interpretation and numerical care is essential for applied engineering problems.
24 videos|68 docs|53 tests |
| 1. What is the definition of the dot product of vectors? | ![]() |
| 2. How is the dot product of vectors calculated? | ![]() |
| 3. What is the significance of the dot product of vectors? | ![]() |
| 4. Can the dot product of vectors be negative? | ![]() |
| 5. How is the dot product related to vector lengths and angles? | ![]() |