Dot Product Calculator

Dot Product Calculator

Calculate the dot product (scalar product) of two vectors in 3D space.

Last updated: April 2026 | By Patchworkr Team

Vector Calculation

Result will appear here...

What is the Dot Product?

The dot product (also called scalar product or inner product) is a fundamental operation in linear algebra and vector mathematics that combines two vectors to produce a single scalar value. Mathematically, for vectors A = (a₁, a₂, a₃) and B = (b₁, b₂, b₃), the dot product is calculated as A · B = a₁b₁ + a₂b₂ + a₃b₃. This operation reveals deep geometric and physical meaning: it simultaneously measures how much the vectors align in direction and scales based on their magnitudes. The dot product is commutative (A · B = B · A) and distributive over addition, making it algebraically elegant. It appears in countless real-world computations, from calculating work in physics to determining orthogonality in computer graphics to measuring similarity in machine learning algorithms. When the dot product equals zero, the vectors are perpendicular—a property used extensively in 3D graphics, structural engineering, and orthogonal decomposition problems.

The geometric interpretation of the dot product is equally powerful: A · B = |A| × |B| × cos(θ), where θ is the angle between the two vectors and |A|, |B| are their magnitudes. This formula explains why the dot product is maximum when vectors point in the same direction (θ = 0°, cos = 1) and minimum when they oppose (θ = 180°, cos = -1). A positive dot product indicates that the vectors share a common directional component, a negative result shows opposition, and zero indicates perpendicularity. This relationship makes the dot product invaluable for computing projections: the magnitude of the projection of vector A onto vector B is (A · B) / |B|. In physics, this translates directly to real applications—calculating the work done by a force (work = force · displacement) or power (power = force · velocity). In computer graphics, dot products determine lighting (normal · lightDirection) and visibility. The dot product also appears in statistics for covariance and correlation calculations, binding together diverse fields through a single elegant mathematical operation.

How to Calculate Dot Product

  1. 1.

    Identify your two vectors and their components

    You need exactly 3 components (i, j, k) for each vector in 3D space. In 2D, you'd use just i and j. Make sure you clearly label which component is which to avoid errors.

  2. 2.

    Multiply corresponding components together

    Multiply the first components (both i values), then multiply the second components (both j values), then the third (both k values). This step extracts the aligned components of each vector pair.

  3. 3.

    Add all three products together

    Sum the results from step 2: (a₁×b₁) + (a₂×b₂) + (a₃×b₃). This accumulation combines the directional agreement across all dimensions into a single scalar value.

  4. 4.

    Interpret the result to understand vector relationship

    Positive result = vectors point generally the same way; Zero = perpendicular; Negative = vectors point generally opposite ways. This interpretation is key for applications like determining lighting angle or force alignment.

  5. 5.

    Optional: Calculate the angle between the vectors

    Use the formula cos(θ) = (A · B) / (|A| × |B|) to find the exact angle. First compute magnitudes: |A| = √(a₁² + a₂² + a₃²), then use inverse cosine on the result to get θ in degrees or radians.

Real-World Example

Force and Displacement Work Calculation

Scenario:
A worker applies a force vector F = (2, 3, 1) N at an angle while moving an object through displacement D = (4, 1, 2) m. Find the work done (W = F · D).
Step 1 - Multiply Components:
F₁ × D₁ = 2 × 4 = 8, F₂ × D₂ = 3 × 1 = 3, F₃ × D₃ = 1 × 2 = 2
Step 2 - Sum Products:
W = 8 + 3 + 2 = 13 Joules
Interpretation:
The positive result (13 J) indicates the force and displacement are aligned—the worker is pushing in the direction of movement, achieving effective work.
Result:
13 Joules

Frequently Asked Questions

What's the difference between dot and cross product?

Dot product returns a scalar (single number), while cross product returns a vector. Dot product measures parallel component, cross product measures perpendicular component.

When is dot product zero?

When the vectors are perpendicular (at 90° angle) or when one vector is a zero vector.

Can dot product be negative?

Yes. A negative dot product indicates the vectors point in generally opposite directions (angle > 90°).

What does the dot product represent geometrically?

It measures the similarity of direction. It's the product of magnitudes and the cosine of the angle between them.

How is dot product used in physics?

It calculates work (force · displacement), power (force · velocity), and determines if forces are aligned.

Is dot product the same for 2D and 3D?

The concept is the same, but 2D has two components while 3D has three. The formula extends naturally.

What about dot product in higher dimensions?

The formula generalizes: multiply corresponding components and sum them all, regardless of dimension.

Can I use dot product for complex numbers?

Yes, with complex conjugate: A · B = Σ(aᵢ × conj(bᵢ)). Real vectors don't need conjugates.

Related Tools