Home Math Dot Product and Angle Between Vectors

Dot Product and Angle Between Vectors

Dot product, magnitudes and angle for two 3D vectors.

Advertisement

How it works

The dot product multiplies matching components and adds them. A zero result means the vectors are at right angles. Divide by the two lengths to get the cosine of the angle between them. Use 2D by setting z to 0.

Advertisement

Formula

u · v = ux × vx + uy × vy + uz × vz
cos(θ) = u · v ÷ (|u| × |v|)

Sources

Example

u = (2, −1, 3) and v = (4, 0, −2). Dot = 8 + 0 − 6 = 2. |u| = √14 = 3.7417 and |v| = √20 = 4.4721. Angle = acos(2 ÷ 16.7332) = 83.14 degrees. Check: cos(83.14°) × 16.7332 = 2.0000.

Frequently asked questions

What does zero mean?

The vectors are perpendicular.

Is the result a vector?

No, it is a single number.

Does the order matter?

No. u · v = v · u.

Can I use 2D vectors?

Yes. Set z = 0.

Advertisement

Related calculators

Percentage Calculator

Find a percent of a number, what percent one number is of another, and percent change, all at once.

Fraction Calculator

Add, subtract, multiply and divide fractions, with the answer simplified.

Scientific Calculator

Online scientific calculator with trig, logs, powers, roots, factorial and degree or radian mode.

Quadratic Formula Calculator

Solve ax² + bx + c = 0, with the discriminant and the vertex.