Calcady
Home / Scientific / Vector Dot Product Calculator — Angle Between Vectors

Vector Dot Product Calculator — Angle Between Vectors

Calculate the scalar dot product, vector magnitudes, and the exact angle between any two 3D vectors using component multiplication.

Vectors

Vector A

Vector B

Dot Product Results

Dot Product (A · B)0Orthogonal
Angle (θ)90.00 °
Magnitude |A|1
Magnitude |B|1
Email LinkText/SMSWhatsApp

Understanding the Vector Dot Product

The dot product (also known as the scalar product) is an algebraic operation that takes two equal-length sequences of numbers—typically coordinate vectors—and returns a single number. Geometrically, it tells you how much of one vector goes in the direction of another.

Formulas

1. Algebraic Definition:

A · B = axbx + ayby + azbz

2. Geometric Definition (Angle):

The dot product is also deeply tied to the angle (θ) between the two vectors and their magnitudes (|A| and |B|):

A · B = |A| |B| cos(θ)

This allows us to solve for the angle:
θ = arccos( (A · B) / (|A| |B|) )

Key Concepts

  • Orthogonality: If the dot product is exactly 0, the vectors are perpendicular (orthogonal) to each other (angle is 90°).
  • Magnitude: The magnitude of a 3D vector is its length, calculated using the Pythagorean theorem in 3D: |A| = √(a_x² + a_y² + a_z²).
  • Parallel Vectors: If the angle is 0° or 180°, the vectors are perfectly parallel (though potentially pointing in opposite directions).

Quick Answer: What does the dot product tell you?

The dot product tells you how aligned two vectors are. A large positive value means they point in similar directions. Zero means they are perpendicular. A negative value means they point in opposite directions. Combined with magnitudes, it gives the exact angle between the vectors.

Two Ways to Compute

A * B = Ax*Bx + Ay*By + Az*Bz = |A|*|B|*cos(theta)

The component form is best for computation. The geometric form (with cosine) is best for understanding. Both always give the same answer.

Key Dot Product Values

Angle Between Vectors cos(theta) Dot Product Sign Meaning
0 degrees+1Maximum positiveParallel (same direction)
45 degrees+0.707PositiveMostly aligned
90 degrees0ZeroPerpendicular
180 degrees-1Maximum negativeAnti-parallel (opposite)

Applications

Calculating Work in Physics

When you push a box across the floor, only the horizontal component of your push does work. If you push at 30 degrees below horizontal with 100 N of force over 5 m, the work is F*d*cos(30) = 100*5*0.866 = 433 J — not 500 J.

3D Graphics & Lighting

In computer graphics, the brightness of a surface depends on the dot product between the surface normal and the light direction. A surface facing the light (dot product = 1) is fully lit. A surface perpendicular to the light (dot product = 0) is in shadow.

Pro Tips

Do This

  • Use the dot product to test perpendicularity. If you need to check whether two vectors are at right angles, compute the dot product. If it equals zero (or very close to zero for floating-point), they are perpendicular.
  • Normalize vectors before comparing angles. The raw dot product depends on magnitudes. To compare alignment independent of length, divide each vector by its magnitude first (unit vectors). Then A dot B directly gives cos(theta).

Avoid This

  • Do not confuse dot product with cross product. The dot product gives a scalar (number). The cross product gives a vector (perpendicular to both inputs). They answer different questions about vector relationships.
  • Do not divide by a zero-magnitude vector. If either vector has magnitude zero, the angle formula divides by zero. A zero vector has no direction, so the angle is undefined.

Frequently Asked Questions

What is the geometric meaning of the dot product?

The dot product equals the length of the projection of A onto B, multiplied by the length of B. It measures how much of vector A lies in the direction of vector B. If A is perpendicular to B, no part of A lies along B, so the dot product is zero.

Can the dot product be negative?

Yes. The dot product is negative when the angle between the vectors exceeds 90 degrees. This means the vectors point in generally opposite directions. The most negative value occurs at 180 degrees (anti-parallel), where A dot B = -|A|*|B|.

How is the dot product used in machine learning?

In machine learning, the dot product is the core operation in neural networks. Each neuron computes the dot product of its input vector with its weight vector, then applies an activation function. Cosine similarity (the dot product of unit vectors) measures semantic similarity between word embeddings in NLP.

Does the dot product work in any number of dimensions?

Yes. The component formula generalizes to any dimension: just multiply corresponding components and sum. A dot B = sum of Ai*Bi for i = 1 to n. In machine learning, vectors with hundreds or thousands of dimensions are common. This calculator handles 3D vectors.

Related Calculators