Vector Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter two vectors a and b by their components to get their dot and cross products, lengths and the angle between them.
Result
Dot product a · b
Cross product a × b: x
- Cross product a × b: y
- Cross product a × b: z
- Magnitude |a|
- Magnitude |b|
- Angle between a and b (degrees)
- Scalar projection of a on b
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- a: x component: enter a number.
- a: y component: enter a number.
- a: z component (0 for 2D): enter a number.
- b: x component: enter a number.
- b: y component: enter a number.
- b: z component (0 for 2D): enter a number.
- Read the result: Dot product a · b; the panel also shows Cross product a × b: x, Cross product a × b: y, Cross product a × b: z, Magnitude |a|, Magnitude |b|, Angle between a and b (degrees) and Scalar projection of a on b.
How this calculator works
Dot product: a · b = aₓbₓ + a_yb_y + a_zb_z = |a||b| cos θ, so the angle is θ = arccos(a · b ÷ (|a||b|)).
Cross product: a × b = (a_yb_z − a_zb_y, a_zbₓ − aₓb_z, aₓb_y − a_ybₓ), a vector perpendicular to both whose length |a||b| sin θ is the area of the parallelogram they span.
Magnitude |a| = √(aₓ² + a_y² + a_z²); scalar projection of a on b = a · b ÷ |b|.
The formula
| Symbol | Meaning |
|---|---|
| a: x component | |
| a: y component | |
| a: z component (0 for 2D) | |
| b: x component | |
| b: y component | |
| b: z component (0 for 2D) | |
| Dot product a · b |
Worked example
| a: x component | 1 |
|---|---|
| a: y component | 2 |
| a: z component (0 for 2D) | 3 |
| b: x component | 4 |
| b: y component | 5 |
| b: z component (0 for 2D) | 6 |
| Cross product a × b: x | -3 |
|---|---|
| Cross product a × b: y | 6 |
| Cross product a × b: z | -3 |
| Magnitude |a| | 3.7417 |
| Magnitude |b| | 8.775 |
| Angle between a and b (degrees) | 12.9332 |
| Scalar projection of a on b | 3.6467 |
Dot product a · b 32
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What does a dot product of 0 mean?
The vectors are perpendicular (at 90°), as long as neither is the zero vector.
What is the difference between the dot and cross product?
The dot product is a number measuring how much two vectors point the same way; the cross product is a vector perpendicular to both.
Does the order matter in a cross product?
Yes: b × a = −(a × b), the same length pointing the opposite way.