Dot Product Calculator
Calculate scalar dot product A·B for 2D and 3D vectors step-by-step with angle and projection analysis.
2D & 3D Dot Product (Scalar Product) Engine
Select vector dimension and enter component coordinates.
Dot Product Output
Quick Summary
Our dot product calculator 2D 3D vector scalar steps tool calculates the scalar dot product $\mathbf{A} \cdot \mathbf{B}$ for 2D and 3D vectors. It evaluates algebraic component sums ($a_x b_x + a_y b_y + a_z b_z$), vector magnitudes, angle between vectors $\theta$, and scalar/vector projections.
How It Works: Scalar Product & Projection Algebra
The dot product multiplies parallel component projections of two vectors:
1. **Algebraic Formula:** Multiply matching axes and sum: $\mathbf{A} \cdot \mathbf{B} = a_x b_x + a_y b_y + a_z b_z$.
2. **Geometric Definition:** $\mathbf{A} \cdot \mathbf{B} = \|\mathbf{A}\| \|\mathbf{B}\| \cos\theta$.
3. **Vector Angle Calculation:** $\theta = \arccos\left(\frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|}\right)$.
4. **Orthogonality Condition:** $\mathbf{A} \cdot \mathbf{B} = 0 \iff \mathbf{A} \perp \mathbf{B}$ (vectors are perpendicular at 90°).
5. **Scalar & Vector Projection:** Scalar projection of A on B equals $\text{proj}_{\mathbf{B}} \mathbf{A} = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{B}\|}$; vector projection equals $\left(\frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{B}\|^2}\right) \mathbf{B}$.
Formula Explanation
Your dot product calculations follow classical scalar product identities:
Step-by-Step Worked Example
Here is a detailed 5-step breakdown for 3D vectors $\mathbf{A} = \langle 2, 3, 4 \rangle$ and $\mathbf{B} = \langle 1, 5, -2 \rangle$:
- Step 1 (Multiply X-Components): $a_x \times b_x = 2 \times 1 = \mathbf{2}$.
- Step 2 (Multiply Y-Components): $a_y \times b_y = 3 \times 5 = \mathbf{15}$.
- Step 3 (Multiply Z-Components): $a_z \times b_z = 4 \times (-2) = \mathbf{-8}$.
- Step 4 (Sum Component Products): $\mathbf{A} \cdot \mathbf{B} = 2 + 15 - 8 = \mathbf{9}$.
- Step 5 (Calculate Angle θ): $\|\mathbf{A}\| = \sqrt{29} \approx 5.385$, $\|\mathbf{B}\| = \sqrt{30} \approx 5.477$. $\cos\theta = \9 / 29.496 \approx 0.3051 \implies \theta = \arccos(0.3051) \approx \mathbf{72.24^\circ}$, delivering **A · B = 9, θ ≈ 72.24°**!
Calculation Examples: Real-World Scenario Comparison
Compare vector inputs, dot products, angles, projections, and orientation statuses:
| Vector A | Vector B | Dot Product (A · B) | Angle θ | Orientation Status |
|---|---|---|---|---|
| 〈2, 3, 4〉 | 〈1, 5, -2〉 | 9 | 72.24° | General Angular |
| 〈4, 3〉 | 〈-3, 4〉 | 0 | 90.00° | Orthogonal (Perpendicular) |
| 〈2, 4, 6〉 | 〈1, 2, 3〉 | 28 | 0.00° | Parallel Vectors |
| 〈5, 0〉 | 〈-5, 0〉 | -25 | 180.00° | Anti-Parallel Vectors |
Benefits of Using the Dot Product Calculator
Utilizing this calculator provides essential mechanical work calculations ($W = \mathbf{F} \cdot \mathbf{d}$), machine learning cosine similarity, and computer graphics shading advantages:
- Physics Mechanical Work ($W = \mathbf{F} \cdot \mathbf{d}$): Computes work done by force applied in the direction of displacement.
- Machine Learning Cosine Similarity: Evaluates document similarity and text vector clustering using normalized dot products.
- Computer Graphics Lambertian Diffuse Lighting: Calculates surface brightness based on the dot product of light direction and surface normal vectors ($I = N \cdot L$).
- Orthogonality Testing: Verifies if two basis vectors are perpendicular without drawing geometric diagrams.
Frequently Asked Questions (FAQ)
What is a dot product?
The dot product (or scalar product) is an algebraic operation that takes two equal-length sequences of numbers (vectors) and returns a single scalar number.
Is the result of a dot product a vector or a scalar?
The result of a dot product is ALWAYS a SCALAR (single number), unlike the cross product which yields a vector.
What does a positive dot product mean?
A positive dot product (A · B > 0) means the angle between the two vectors is acute (θ < 90°), pointing in generally the same direction.
What does a negative dot product mean?
A negative dot product (A · B < 0) means the angle between the two vectors is obtuse (θ > 90°), pointing in generally opposing directions.
What does a zero dot product mean?
A zero dot product (A · B = 0) means the vectors are orthogonal (perpendicular at 90°).
How is dot product used to find the angle between two vectors?
θ = arccos((A · B) / (||A|| * ||B||)).
What is a scalar projection?
The scalar projection proj_B(A) is the length of the orthogonal projection of vector A onto vector B: proj_B(A) = (A · B) / ||B||.
What is a vector projection?
The vector projection of A onto B is a vector parallel to B whose magnitude is the scalar projection: Proj_B(A) = ((A · B) / ||B||^2) * B.
Is dot product commutative?
YES. A · B = B · A.
How is dot product used in AI & NLP (Natural Language Processing)?
NLP uses normalized dot products (cosine similarity) to measure semantic similarity between word embedding vectors (e.g. Word2Vec, BERT).