Dot Product Calculator

The dot product of vectors A and B is computed as A . B = a1*b1 + a2*b2 (+ a3*b3 for 3D). For vectors (1, 2, 3) and (4, 5, 6), the dot product is 32 with an angle of approximately 12.9 degrees between them. The dot product also equals |A||B|cos(theta), which makes it useful for finding angles between vectors. Enter two vectors below.

Quick Answer

The dot product of (1, 2, 3) and (4, 5, 6) is 32, with an angle of approximately 12.93 degrees between the vectors.

Vector A

Vector B

Common Examples

Input Result
(1, 2) . (3, 4) Dot product: 11
(1, 2, 3) . (4, 5, 6) Dot product: 32, angle: 12.93°
(1, 0) . (0, 1) Dot product: 0 (orthogonal, 90°)
(3, 4) . (3, 4) Dot product: 25, angle: 0°

How It Works

The formula

The dot product (also called the scalar product) of two vectors is the sum of the products of their corresponding components.

For 2D vectors: \(\mathbf{A} \cdot \mathbf{B} = a_x b_x + a_y b_y\)

For 3D vectors: \(\mathbf{A} \cdot \mathbf{B} = a_x b_x + a_y b_y + a_z b_z\)

The result is a scalar (a single number), not a vector.

Angle between vectors

The dot product relates to the angle between vectors:

\[\mathbf{A} \cdot \mathbf{B} = |\mathbf{A}||\mathbf{B}|\cos\theta\]
Solving for the angle: $$\theta = \arccos\left(\frac{\mathbf{A} \cdot \mathbf{B}}{ \mathbf{A}   \mathbf{B} }\right)$$
The magnitude of a vector is: $$ \mathbf{A} = \sqrt{a_x^2 + a_y^2 + a_z^2}$$

Key properties

  • If the dot product is 0 and neither vector is zero, the vectors are orthogonal (perpendicular, 90 degrees apart)
  • If the dot product is positive, the angle between the vectors is less than 90 degrees
  • If the dot product is negative, the angle is greater than 90 degrees
  • The dot product is commutative: A . B = B . A

Worked example

For A = (1, 2, 3) and B = (4, 5, 6): A . B = (1)(4) + (2)(5) + (3)(6) = 4 + 10 + 18 = 32. A = sqrt(1 + 4 + 9) = sqrt(14) = 3.742. B = sqrt(16 + 25 + 36) = sqrt(77) = 8.775. Angle = arccos(32 / (3.742 x 8.775)) = arccos(0.9746) = 12.93 degrees.

Related Calculators

Frequently Asked Questions

What does the dot product tell you?
The dot product measures how much two vectors point in the same direction. A positive dot product means the vectors point generally in the same direction (angle less than 90 degrees). A negative value means they point in generally opposite directions (angle greater than 90 degrees). Zero means the vectors are perpendicular.
What is the difference between dot product and cross product?
The dot product produces a scalar (number) and works in any dimension. The cross product produces a vector and is defined only in 3D. The dot product uses cosine of the angle between vectors, while the cross product uses sine. Use the dot product to find angles or projections, and the cross product to find perpendicular vectors or areas.
Can you compute a dot product in 2D?
Yes. The 2D dot product uses only x and y components: A . B = ax*bx + ay*by. All the same properties (angle calculation, orthogonality check) apply in 2D.
What happens when one vector is zero?
The dot product with a zero vector is always 0, regardless of the other vector. The angle is undefined when either vector has zero magnitude, since you cannot divide by zero in the angle formula.
How is the dot product used in practice?
Common applications include finding the angle between two directions, projecting one vector onto another, testing whether vectors are perpendicular, lighting calculations in computer graphics (how much a surface faces a light source), and calculating work in physics (force dot displacement).