Vector Dot Product Calculator

Turning Two Vectors Into a Single Number

Unlike vector addition, the dot product doesn't produce another vector — it collapses two vectors down into a single scalar that captures how much they point in the same direction. A positive result means the vectors broadly align, a negative result means they point broadly opposite, and zero means they're perpendicular.

The Formula

2D: A · B = (Ax×Bx) + (Ay×By)
3D: A · B = (Ax×Bx) + (Ay×By) + (Az×Bz)

Worked Example

For vectors A = (3, 4) and B = (1, 2):

Dot product calculation
StepCalculationResult
Ax×Bx3 × 13
Ay×By4 × 28
Sum3 + 811

Where This Matters

  • Work in physics — mechanical work equals the dot product of a force vector and a displacement vector.
  • Lighting in 3D graphics — the brightness of a surface depends on the dot product between its normal vector and the direction to the light source.
  • Testing perpendicularity — a dot product of exactly zero confirms two vectors are at right angles, a quick check used throughout geometry and engineering.

How to Use This Calculator

  1. Choose the dimension: 2D Vectors or 3D Vectors.
  2. Enter Vector A's x, y (and z for 3D) components.
  3. Enter Vector B's x, y (and z for 3D) components.
  4. Select Calculate to get the dot product.

Related Calculations

Use the dot product result to find an angle directly with the Angle Between Vectors Calculator, or compute a vector result instead with the Vector Cross Product Calculator.

Principles of the Vector Dot Product (Scalar Product)

The vector dot product — also referred to as the scalar product or inner product — is an algebraic operation that takes two equal-length coordinate vectors and returns a single real scalar number. The dot product combines the algebraic component-wise products with the geometric projection of one vector onto another.

The Dual Definitions of the Dot Product

Algebraic Definition: u · v = uxvx + uyvy + uzvz = ∑i=1N (ui × vi)
Geometric Definition: u · v = ||u|| × ||v|| × cos(θ)

Where ||u|| and ||v|| are the Euclidean magnitudes of vectors u and v, and θ is the angle between them (0° ≤ θ ≤ 180°).

Orthogonality and Directional Character

  • Orthogonal / Perpendicular Vectors (u · v = 0): When two non-zero vectors are perpendicular, θ = 90° and cos(90°) = 0, producing a dot product of exactly zero. The dot product serves as the primary test for orthogonality in linear algebra.
  • Acute Angle (u · v > 0): The vectors point generally in the same direction (θ < 90°).
  • Obtuse Angle (u · v < 0): The vectors oppose each other (θ > 90°).
  • Self-Dot Product (u · u = ||u||²): The dot product of a vector with itself equals the square of its Euclidean magnitude.

Vector Projection Formulas

The scalar and vector projections of vector u onto vector v are defined as:

Scalar Projection: compv(u) = (u · v) / ||v||
Vector Projection: projv(u) = [ (u · v) / ||v||² ] × v

Step-by-Step Worked Calculation Example

Example: Calculating Mechanical Work and Cosine Similarity

Problem: A mechanical conveyor exerts a constant 3D force vector F = 〈50.0, 30.0, -10.0〉 Newtons on a manufactured part, displacing it along vector d = 〈4.0, 2.0, 6.0〉 meters. Calculate: (1) The mechanical work performed in Joules; (2) The magnitudes ||F|| and ||d||; and (3) The angle θ between force and displacement.

Step 1: Calculate mechanical work via algebraic dot product (W = F · d):

W = (50.0 × 4.0) + (30.0 × 2.0) + (-10.0 × 6.0)

W = 200.0 + 60.0 - 60.0 = 200.00 Joules (N·m)

Step 2: Calculate vector magnitudes:

||F|| = √[ 50² + 30² + (-10)² ] = √[ 2,500 + 900 + 100 ] = √3,500 = 59.16 N

||d|| = √[ 4² + 2² + 6² ] = √[ 16 + 4 + 36 ] = √56 = 7.483 m

Step 3: Solve for the angle θ between vectors:

cos(θ) = (F · d) / (||F|| × ||d||) = 200.0 / (59.16 × 7.483) = 200.0 / 442.70 = 0.45177

θ = arccos(0.45177) = 63.14°

Conclusion: The conveyor performs 200.0 Joules of work with a force-displacement angle of 63.14°.

Applications in Machine Learning: Cosine Similarity

In modern artificial intelligence and Large Language Model (LLM) embeddings, Cosine Similarity compares semantic similarity between two high-dimensional text embedding vectors: Similarity = (A · B) / (||A|| ||B||).

The Gram-Schmidt Orthogonalization Process

In numerical linear algebra, the Gram-Schmidt Orthogonalization Algorithm converts any set of linearly independent vectors {v1, v2, …, vk} into an orthogonal basis {u1, u2, …, uk} using successive vector projections and dot products:

u1 = v1
u2 = v2 - proju1(v2) = v2 - [ (v2 · u1) / ||u1||² ] × u1
uk = vk - ∑j=1k-1 [ (vk · uj) / ||uj||² ] × uj

Normalizing each resulting vector (ei = ui / ||ui||) yields an Orthonormal Basis, forming the foundation of QR matrix factorizations and Kalman filtering.

Covariance Matrices as Centered Dot Products

In multivariate statistics and quantitative finance, if data observations are mean-centered into feature vectors Xi and Xj, the sample covariance between the two random variables equals their normalized dot product:

Cov(Xi, Xj) = (Xi · Xj) / (N - 1)

Thus, the entire sample covariance matrix Σ is calculated via matrix dot product multiplication: Σ = (XT × X) / (N - 1).

Matrix Formulation of the Dot Product and Bilinear Forms

In advanced linear algebra, treating vectors as column matrices allows the dot product to be formulated as matrix multiplication:

u · v = uT × v = [ u1, u2, …, un ] × [ [v1], [v2], […], [vn] ]

More generally, in Riemannian differential geometry and general relativity, the inner product is weighted by a Metric Tensor (gij) to define spacetime intervals: 〈u, v〉 = uT × G × v = ∑ gij ui vj.

Bra-Ket (Dirac) Notation in Quantum State Projections

In quantum mechanics, state vectors are denoted as "ket" vectors |ψ〉 and dual vectors as "bra" vectors 〈φ|. The inner product 〈φ|ψ〉 represents the complex probability amplitude of a quantum state |ψ〉 collapsing into state |φ〉 upon observation, where the transition probability is the squared magnitude: P = |〈φ|ψ〉|².

The Dual Space and Linear Functionals (Riesz Representation Theorem)

In functional analysis, the set of all continuous linear functionals mapping vectors to real scalar numbers forms the Dual Vector Space (V*).

The celebrated Riesz Representation Theorem establishes that for any linear functional f(v) on a real Hilbert space H, there exists a unique vector u ∈ H such that the functional evaluates identically as the vector dot product:

f(v) = u · v  (for all v ∈ H)

This profound mathematical duality bridges abstract linear transformations with concrete geometric inner products in theoretical physics.

Kernel Trick and Non-Linear Support Vector Machines

In machine learning classification, the Kernel Trick implicitly computes high-dimensional vector dot products using Mercer kernel functions (such as Radial Basis Function RBF kernels: K(x, y) = exp(-γ ||x - y||²)), allowing linear classifiers to separate non-linearly separable data in infinite-dimensional feature spaces.

Parseval's Identity in Fourier Analysis

In mathematical harmonic analysis, Parseval's identity proves that the continuous L2 inner product (dot product) of two time-domain signals equals the inner product of their corresponding frequency spectra, preserving total signal energy.