Vectors

Calculate the dot product of two vectors

Enter two vectors with the same number of components. The calculator multiplies matching components, adds those products, and explains what the scalar says about their angle.

Enter two vectors with matching dimensions

Separate coordinates with commas or spaces. Integers, finite decimals, and simple fractions are supported.

Multiply corresponding components and add the three products

ab=32\mathbf a\cdot\mathbf b=32
Conditions
  • Both vectors have three components.
  • The entries are treated as real numbers.
  • The result is a scalar, not a vector.

Steps

  1. Pair corresponding components Match first with first, second with second, and third with third.(1)(4)+(2)(5)+(3)(6)(1)(4)+(2)(5)+(3)(6)
  2. Evaluate each product The component products are 4, 10, and 18.4+10+184+10+18
  3. Add the products The sum is the scalar dot product.ab=32\mathbf a\cdot\mathbf b=32
Independent check

The geometric check gives ||a||||b||cos(theta)=sqrt(14)sqrt(77)(32/sqrt(1078))=32.

What this dot product covers

The dot product of equal-dimensional vectors a and b is a·b=a_1b_1+...+a_nb_n. It is a scalar, and for nonzero vectors it also equals ||a||||b||cos(theta).

Use vectors from two through six dimensions

Accept equal-length vectors and display every matching component product before the sum.

Examples: 2D, 3D, n-dimensional component lists

Keep exact fractional entries

Multiply integers, finite decimals, or simple fractions without replacing exact values too early.

Examples: 1/2, -3/4, 0.25

Interpret orthogonality and angle type

For nonzero vectors, identify perpendicular, acute, or obtuse relationships from the dot product sign.

Examples: a·b=0, a·b>0, a·b<0

Compute the angle when it is defined

Use cos(theta)=(a·b)/(||a||||b||) only when neither vector is the zero vector.

Examples: theta=90 degrees, cosine similarity

Enter enough information for one clear task

  1. 1
    Enter vector A

    Separate components with commas or spaces and keep their coordinate order fixed.

  2. 2
    Enter vector B with the same length

    Each component needs a matching position. The dot product is not defined here for unequal dimensions.

  3. 3
    Inspect the component products

    Check signs before adding, especially when one vector contains negative entries.

  4. 4
    Use the scalar appropriately

    Interpret zero as orthogonality only for vectors in an inner-product space, and compute an angle only when both magnitudes are nonzero.

Examples to try

Use these examples to recognize the method, compare equivalent forms, and check your own work.

Two-dimensional vectors

Multiply matching coordinates and add.

(2,3)(4,1)(2,3)\cdot(4,-1)

Expected result

2(4)+3(1)=52(4)+3(-1)=5

Three-dimensional vectors

Add all three component products.

(1,2,3)(4,5,6)(1,2,3)\cdot(4,5,6)

Expected result

4+10+18=324+10+18=32

Orthogonal vectors

The positive and negative products cancel.

(3,4)(4,3)(3,4)\cdot(4,-3)

Expected result

1212=012-12=0

Fractional components

Keep both products exact before adding.

(12,1)(4,32)\left(\frac12,-1\right)\cdot\left(4,\frac32\right)

Expected result

232=122-\frac32=\frac12

Vector dotted with itself

The self-dot product is the squared magnitude.

(2,1,2)(2,1,2)(-2,1,2)\cdot(-2,1,2)

Expected result

4+1+4=94+1+4=9

Obtuse relationship

A negative dot product means the angle is obtuse for nonzero vectors.

(1,0)(2,3)(1,0)\cdot(-2,3)

Expected result

2-2

Zero vector

Every component product is zero, but the angle is undefined.

(0,0,0)(5,2,1)(0,0,0)\cdot(5,-2,1)

Expected result

00

Use the dot product to find an angle

Both vectors are nonzero, so the component formula gives the scalar product and the geometric formula gives their angle.

a=(1,2),b=(2,1)\mathbf a=(1,2),\qquad\mathbf b=(2,1)
  1. 1
    Calculate the dot product

    Multiply corresponding components and add.

    ab=1(2)+2(1)=4\mathbf a\cdot\mathbf b=1(2)+2(1)=4
  2. 2
    Calculate both magnitudes

    Each vector has squared magnitude 5.

    a=b=5\|\mathbf a\|=\|\mathbf b\|=\sqrt5
  3. 3
    Solve for the cosine

    Divide the dot product by the product of the magnitudes.

    cosθ=455=45\cos\theta=\frac4{\sqrt5\sqrt5}=\frac45
  4. 4
    Find the angle

    Apply inverse cosine and label the decimal as an approximation.

    θ=cos1(45)36.87\theta=\cos^{-1}\left(\frac45\right)\approx36.87^\circ
ab=4,θ36.87\mathbf a\cdot\mathbf b=4,\qquad\theta\approx36.87^\circ

Verification: The Cauchy-Schwarz bound gives |4|<=sqrt(5)sqrt(5)=5, and cos(theta)=0.8 lies in the valid interval from negative 1 to 1.

Common mistakes and how to fix them

Returning a vector instead of a scalar

Problem: Report the component products as (4,10,18).

Why it matters: The dot product adds those products and produces one scalar.

Better approach: Sum every matching component product after computing it.

Using vectors with different lengths

Problem: Ignore the unmatched component of a 3D vector.

Why it matters: The component definition requires one partner for every coordinate.

Better approach: Use equal-dimensional vectors or convert the data to a clearly defined common space.

Confusing dot product with cross product

Problem: Expect a perpendicular 3D vector as the result.

Why it matters: A dot product is scalar; a 3D cross product is a different operation with a vector result.

Better approach: Choose the operation by the desired output and interpretation.

Finding an angle with a zero vector

Problem: Divide by ||0|| when applying the cosine formula.

Why it matters: The zero vector has magnitude zero, so the denominator vanishes and its direction is undefined.

Better approach: Report the dot product as zero but the angle as undefined.

Checks, assumptions, and limits

How results are checked

  • Vector dimensions are compared before components are multiplied.
  • The component sum is recomputed from exact parsed values.
  • The bound |a·b|<=||a||||b|| is checked before an angle is reported.
  • Angle output is withheld when either magnitude is zero.

When to stop and revise the input

  • This release accepts finite real integers, decimals, and simple fractions.
  • Both vectors must contain the same number of components.
  • Symbolic vector components and weighted inner products are outside this tool's scope.
  • An angle from a rounded cosine is approximate and is labeled accordingly.

Calculate the dot product of two vectors FAQ

Is the scalar product the same as the dot product?

Yes in this Euclidean-vector context. Both names refer to multiplying corresponding components and summing to produce one scalar.

What does a dot product of zero mean?

Two nonzero Euclidean vectors with dot product zero are orthogonal. If one vector is zero, the product is still zero but an angle is not defined.

Can the dot product be negative?

Yes. For two nonzero vectors, a negative dot product means their angle is greater than 90 degrees and less than 180 degrees.

Why must the vectors have the same dimension?

The component formula pairs each coordinate of one vector with the coordinate in the same position of the other. Unequal lengths leave unmatched components.

How is the dot product related to vector length?

A vector dotted with itself equals the square of its Euclidean magnitude: a·a=||a|| squared.

Sources and curriculum alignment

This page follows standard introductory mathematics notation and learning sequences. Use these references to continue with a complete course treatment.

Choose the resource that matches what you need to do next.

Created by Mathos AI. Methods, conditions, and checks are shown so you can review the mathematical reasoning.