Dot and Cross Product
With a — x 1, a — y 2, a — z 3, b — x 4 and 2 more fields, dot and cross product comes to 32.0000 — dot product. It is reached in 8 steps, the last of which is 1 * 4 + 2 * 5 + 3 * 6, and each one is printed on the page with its numbers filled in. The formula is the one published by NIST Digital Library of Mathematical Functions, not an approximation fitted to it.
Dot product, cross product, magnitudes and the angle between two 3-D vectors. The dot returns a number, the cross returns a vector — that is the difficulty.
Formula and sources checked · How we check
a — x 1, a — y 2, a — z 3, b — x 4
32.0000
Dot product for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.
It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.
- Dot product, a · b
1 * 4 + 2 * 5 + 3 * 632- Cross product, x component
2 * 6 - 3 * 5-3- Cross product, y component
3 * 4 - 1 * 66- Cross product, z component
1 * 5 - 2 * 4-3- Length of a
sqrt(1 * 1 + 2 * 2 + 3 * 3)3.742- Length of b
sqrt(4 * 4 + 5 * 5 + 6 * 6)8.775- Length of the cross product
sqrt(-3 * -3 + 6 * 6 + -3 * -3)7.348- Angle between them
acos(max(-1, min(1, 32 / (3.7416574 * 8.7749644)))) * 180 / pi12.933 deg
Worked example
(1, 2, 3) · (4, 5, 6) = 32, and their cross product is (−3, 6, −3). The dot is a single number; the cross is a vector perpendicular to both, and its length 7.348 is the area of the parallelogram the two vectors span.
How to work it out yourself
- 1.Use the dot product for projection and for angles. It is positive when the vectors point the same way, zero when they are perpendicular, and negative when they oppose.
- 2.Use the cross product for a direction perpendicular to both — a surface normal, a torque, a magnetic force. Its length is the area of the parallelogram the two vectors span.
- 3.The cross product is anti-commutative: b × a is the negative of a × b. The dot product does not care about order.
- 4.For two-dimensional vectors, set the z components to zero. The dot product works unchanged and the cross product collapses to its z component alone, which is the signed area.
Dot product against the z component of b
| b — z | Dot product | Angle between them | Length of the cross product |
|---|---|---|---|
| -6 | -4.0000 | 97 deg | 32.59 |
| -4 | 2.0000 | 85.94 deg | 28.18 |
| -2 | 8.0000 | 71.41 deg | 23.79 |
| -1 | 11.0000 | 63.02 deg | 21.61 |
| 0 | 14.0000 | 54.24 deg | 19.44 |
| 1 | 17.0000 | 45.49 deg | 17.29 |
| 2 | 20.0000 | 37.17 deg | 15.17 |
| 3 | 23.0000 | 29.62 deg | 13.08 |
| 4 | 26.0000 | 23.02 deg | 11.05 |
| 5 | 29.0000 | 17.44 deg | 9.11 |
| 6 | 32.0000 | 12.93 deg | 7.35 |
The dot product passes through zero exactly where the angle passes through 90°. That is the test the dot product exists for: two vectors are perpendicular if and only if their dot product is zero.
The formula
- Dot product, a · b
1 * 4 + 2 * 5 + 3 * 6 - Cross product, x component
2 * 6 - 3 * 5 - Cross product, y component
3 * 4 - 1 * 6 - Cross product, z component
1 * 5 - 2 * 4 - Length of a
sqrt(1 * 1 + 2 * 2 + 3 * 3) - Length of b
sqrt(4 * 4 + 5 * 5 + 6 * 6) - Length of the cross product
sqrt(-3 * -3 + 6 * 6 + -3 * -3) - Angle between them
acos(max(-1, min(1, 32 / (3.7416574 * 8.7749644)))) * 180 / pi
Source: NIST Digital Library of Mathematical Functions — vectors and vector operations, NIST SP 811 — vector quantities and their units
Questions people actually ask
- What is the difference between the dot and cross product?
- The dot product returns a number, the cross product returns a vector. The dot measures how much two vectors point the same way; the cross produces a third vector perpendicular to both, with a length equal to the area they span. The dot exists in any number of dimensions; the cross product is specific to three.
- How do you find the angle between two vectors?
- cos θ = (a · b) ÷ (|a| |b|), then take the inverse cosine. For (1, 2, 3) and (4, 5, 6) that gives 12.93°. The formula fails if either vector has zero length, because a point has no direction.
- What does a dot product of zero mean?
- The vectors are perpendicular — or one of them is the zero vector. It is the cleanest test for a right angle there is, and it needs no trigonometry at all.
- What is the right-hand rule?
- Point the fingers of your right hand along a, curl them towards b, and your thumb points along a × b. It fixes the sign, which the algebra alone does not: the same two vectors could have a perpendicular pointing either way.
- Can you take a cross product in two dimensions?
- Not properly. Treating 2-D vectors as 3-D ones with z = 0 gives a cross product pointing purely along z, and that single number — ax·by − ay·bx — is the signed area of the parallelogram. It is used constantly in graphics for deciding which side of a line a point falls on.
Related
- Midpoint CalculatorThe midpoint of two points, with the distance, the slope and the perpendicular bisector — what a coordinate-geometry question asks about the same pair.
- Distance Formula CalculatorDistance between two points in the plane or in space, with the midpoint and the slope, and every step of the square root shown.
- Pythagorean Theorem CalculatorSolves a² + b² = c² in either direction — the hypotenuse from two legs, or the missing leg from a leg and the hypotenuse — with the squares shown.
- Diagonal & Rafter Length CalculatorHypotenuse of a right triangle in feet and inches — brace lengths, rafter runs, and squaring a layout.
- Circle CalculatorArea, circumference and radius of a circle from its diameter — in square feet and square inches.
- Tank & Cylinder Volume CalculatorVolume of a cylinder in cubic feet, US gallons and liters — round tanks, pools, culverts and post holes.
Put this calculator on your site
Free, no attribution required beyond the link.
<iframe src="https://rulecalculators.com/embed/vector-product" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Dot and Cross Product"></iframe>