Dot Product Calculator Formula
Understand the math behind the dot product calculator. Each variable explained with a worked example.
Formulas Used
Dot
dot = a1*b1 + a2*b2 + a3*b3Mag A
mag_a = sqrt(pow(a1,2) + pow(a2,2) + pow(a3,2))Mag B
mag_b = sqrt(pow(b1,2) + pow(b2,2) + pow(b3,2))Angle
angle = acos((a1*b1 + a2*b2 + a3*b3) / (sqrt(pow(a1,2)+pow(a2,2)+pow(a3,2)) * sqrt(pow(b1,2)+pow(b2,2)+pow(b3,2)))) * 180 / piVariables
| Variable | Description | Default |
|---|---|---|
a1 | Vector A: x | 1 |
a2 | Vector A: y | 2 |
a3 | Vector A: z | 3 |
b1 | Vector B: x | 4 |
b2 | Vector B: y | 5 |
b3 | Vector B: z | 6 |
How It Works
Dot Product
Formula
A · B = a₁b₁ + a₂b₂ + a₃b₃
Geometric Interpretation
A · B = So: theta = arccos(A · B / ( ))A × B × cos(theta) A × B
Properties
Worked Example
Dot product of (1,2,3) and (4,5,6).
- 01A · B = 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32
- 02|A| = √(1+4+9) = √14 ≈ 3.742
- 03|B| = √(16+25+36) = √77 ≈ 8.775
- 04cos(theta) = 32/(3.742 × 8.775) ≈ 0.9746
- 05theta ≈ 12.93°
Frequently Asked Questions
What is the dot product?
The dot product is a way to multiply two vectors to get a scalar (single number). It measures how much two vectors point in the same direction.
When is the dot product zero?
The dot product is zero when the vectors are perpendicular (orthogonal). This is a common test for perpendicularity.
What is the difference between dot product and cross product?
The dot product gives a scalar and measures alignment. The cross product gives a vector perpendicular to both inputs and measures the area of the parallelogram they span.
Learn More
Guide
Introduction to Matrices - Complete Guide
Learn the fundamentals of matrices including notation, operations, determinants, inverses, and applications in systems of equations, transformations, and data science.
Ready to run the numbers?
Open Dot Product Calculator