Skip to main content

Dot Product Calculator

Calculate the dot product of two vectors from coordinates or from magnitudes and angle. You can also find the angle between vectors, check whether vectors are orthogonal (perpendicular), and compute the scalar projection and vector projection of A onto B.

Background

The dot product measures how strongly two vectors point in the same direction. A positive dot product means they point generally the same way, a negative dot product means they point more opposite ways, and a dot product of 0 means the vectors are perpendicular.

Enter vector values

Tip: Use Coordinates if you know vector components like (2, 3) or (1, -2, 4).

For n-dimensional vectors, enter comma-separated values like 1, 2, -3, 4.

Vector coordinates

Both vectors must have the same number of components.

Magnitudes + Angle

Units: degrees

Chips prefill and calculate immediately.

Display options

Result

No results yet. Choose a mode, enter values, and click Calculate.

How to use this calculator

  • Choose Coordinates to calculate the dot product from vector components.
  • Choose Magnitudes + Angle to use A · B = |A||B|cos(θ).
  • Choose Find Angle to compute the angle between two vectors from coordinates.
  • Choose Orthogonality Check to test whether the vectors are perpendicular.

How this calculator works

  • 2D dot product: A · B = x₁x₂ + y₁y₂
  • 3D dot product: A · B = x₁x₂ + y₁y₂ + z₁z₂
  • Magnitudes + angle: A · B = |A||B|cos(θ)
  • Angle between vectors: cos(θ) = (A · B) / (|A||B|)
  • Scalar projection of A onto B: compB(A) = (A · B)/|B|
  • Vector projection of A onto B: projB(A) = ((A · B)/|B|²) B
  • Orthogonal vectors: if A · B = 0, the vectors are perpendicular.

Formula & Equations Used

2D: A · B = x₁x₂ + y₁y₂

3D: A · B = x₁x₂ + y₁y₂ + z₁z₂

General: A · B = Σ(aᵢbᵢ)

From magnitudes and angle: A · B = |A||B|cos(θ)

Find angle: θ = cos⁻¹((A · B)/(|A||B|))

Scalar projection: compB(A) = (A · B)/|B|

Vector projection: projB(A) = ((A · B)/|B|²) B

Example Problem & Step-by-Step Solution

Example 1 — 2D coordinates

Let A = (3, 4) and B = (5, 2).

  1. Use A · B = x₁x₂ + y₁y₂.
  2. A · B = 3·5 + 4·2.
  3. A · B = 15 + 8 = 23.

Example 2 — orthogonal vectors

Let A = (2, 3) and B = (-3, 2).

  1. Compute the dot product: 2(-3) + 3(2).
  2. -6 + 6 = 0.
  3. Since the dot product is 0, the vectors are perpendicular.

Example 3 — projection of A onto B

Let A = (3, 4) and B = (1, 0). Find the scalar projection and vector projection of A onto B.

  1. First compute the dot product: A · B = 3(1) + 4(0) = 3.
  2. Find the magnitude of B: |B| = √(1² + 0²) = 1.
  3. Scalar projection: compB(A) = (A · B)/|B| = 3/1 = 3.
  4. Vector projection: projB(A) = ((A · B)/|B|²)B = (3/1)(1,0) = (3,0).

Frequently Asked Questions

Q: What does a positive dot product mean?

It means the vectors point generally in the same direction.

Q: What does a zero dot product mean?

It means the vectors are orthogonal, or perpendicular.

Q: What does a negative dot product mean?

It means the vectors point more opposite than aligned.

Q: Can I use this for 2D, 3D, and n-dimensional vectors?

Yes. The calculator supports 2D, 3D, and comma-separated n-dimensional vectors.