Calcoid

Dot Product Calculator

Calculate the dot product of two vectors, plus magnitudes, cosine similarity, and the angle between them.

Dot Product Calculator

Vector A

Vector B

Dot product (A · B)

32

Angle between A and B: 12.93 deg

Magnitude |A|

3.7417

Magnitude |B|

8.775

cos(theta)

0.9746

Angle (radians)

0.2257

Scalar projection of A onto B

3.6467

Vector projection of A onto B

(1.6623, 2.0779, 2.4935)

Relationship: Acute angle (less than 90 degrees)
Show formula

A · B = axbx + ayby + azbz

theta = arccos( (A · B) / (|A| |B|) )

A · B = 32

Frequently Asked Questions about the Dot Product Calculator

How do you calculate the dot product of two vectors?
Multiply matching components and add the results. For 3D vectors the dot product is a.b = ax*bx + ay*by + az*bz, and for 2D vectors you drop the z term. The result is a single number (a scalar), not a vector. For example, (1, 2, 3) dotted with (4, 5, 6) gives 4 + 10 + 18 = 32.
How is the angle between two vectors found from the dot product?
The dot product relates to the angle by a.b = |a| |b| cos(theta), where |a| and |b| are the vector magnitudes. Solving for the angle gives theta = arccos((a.b) / (|a| |b|)). This calculator reports that angle in both degrees and radians, in the range 0 to 180 degrees. The angle is undefined when either vector has zero length.
What does a positive, zero, or negative dot product mean?
The sign tells you how the vectors point relative to each other. A positive dot product means the angle between them is less than 90 degrees (they point the same general way), a value of exactly zero means they are perpendicular, and a negative value means the angle is greater than 90 degrees (they oppose). This calculator labels the relationship as acute, perpendicular, obtuse, parallel, or anti-parallel.
What is the scalar and vector projection of A onto B?
The scalar projection is the signed length of A measured along the direction of B, equal to (a.b) / |b|. The vector projection points along B with that length and equals ((a.b) / |b|^2) times B. Both require B to have nonzero length, so they are undefined when B is the zero vector.
Does this calculator work for both 2D and 3D vectors?
Yes. Pick 2D to enter x and y components only, or 3D to add a z component to each vector. In 2D mode the z fields are ignored, so you can leave them blank. The dot product, magnitudes, angle, and projections all adjust to the dimension you select.
What is the difference between the dot product and the cross product?
The dot product returns a scalar and measures how aligned two vectors are, which makes it useful for angles and projections. The cross product, defined in 3D, returns a vector that is perpendicular to both inputs and whose length equals the area of the parallelogram they span. Use the dot product for angle and projection questions and the cross product for direction and area.

Related Calculators

More calculators in "Math"

See all 202 calculators in "Math"