Dot Product Calculator
Compute the dot product (scalar product) of two vectors and find the angle between them. Supports 2D–5D with full step-by-step working.
Vector A
Vector B
| A · B value | Angle θ | Meaning | Example |
|---|---|---|---|
| = 0 | 90° | Orthogonal (perpendicular) | Coordinate axes î, ĵ, k̂ |
| > 0 | 0° < θ < 90° | Acute — similar direction | Force and motion aligned |
| < 0 | 90° < θ < 180° | Obtuse — opposing direction | Normal force vs gravity |
| = |A||B| | 0° | Parallel — same direction | Parallel vectors |
| = −|A||B| | 180° | Anti-parallel — opposite | Opposing forces |
The Dot Product in Different Fields
- Physics — Work: W = F · d. Work equals force dotted with displacement. If force is perpendicular to motion (θ=90°), W=0 — no work is done despite the force (e.g. circular motion).
- Machine Learning — Cosine Similarity: cosine_sim = (A·B)/(|A||B|) measures how similar two vectors are regardless of magnitude. Used in NLP (word2vec, BERT embeddings) to compare meaning.
- Computer Graphics — Lighting: The brightness of a surface = dot product of the surface normal and the light direction. Lambert's cosine law.
- Statistics — Covariance: The covariance of two zero-mean data vectors is proportional to their dot product.
Frequently Asked Questions
Why is the dot product called the "scalar" product?
Because the result is always a scalar (a single number), not a vector. This contrasts with the cross product, which produces a vector. "Dot product" refers to the dot notation (A · B), while "scalar product" describes the type of result. Both terms are used interchangeably in UK A-Level and IB curricula.
Does the dot product work in any number of dimensions?
Yes. Unlike the cross product (which is only defined in 3D and 7D), the dot product generalizes to any dimension: A · B = Σᵢ aᵢbᵢ. This makes it central to machine learning where feature vectors may have thousands of dimensions. In functional analysis, the dot product generalizes to an inner product in infinite-dimensional spaces.