A little context. A clearer answer.
When this calculator is useful
The dot product sums matching component products. The cross product follows the right-hand rule. Use atan2 of cross-product magnitude and dot product for the angle. Project A onto B using (A·B)B/|B|²; the scalar projection keeps its sign. For a related calculation, try Matrix calculator.
What to enter
| Input | What it means | Example value |
|---|---|---|
| 2D / 3D | 2D / 3D: 2D / 3D | 3D |
| Aₓ | First vector’s component along the x axis. Aₓ: -1000000…1000000 | 1 |
| Aᵧ | First vector’s component along the y axis. Aᵧ: -1000000…1000000 | 2 |
| A_z | First vector’s component along the z axis. A_z: -1000000…1000000 | 3 |
| Bₓ | Second vector’s component along the x axis. Bₓ: -1000000…1000000 | 4 |
| Bᵧ | Second vector’s component along the y axis. Bᵧ: -1000000…1000000 | 5 |
| B_z | Second vector’s component along the z axis. B_z: -1000000…1000000 | 6 |
How the calculation works
- Change the inputs to explore your own scenario. 2D / 3D: 2D / 3D; Aₓ: -1000000…1000000 ; Aᵧ: -1000000…1000000 ; A_z: -1000000…1000000 ; Bₓ: -1000000…1000000 ; Bᵧ: -1000000…1000000 ; B_z: -1000000…1000000 .
- A·B=Σaᵢbᵢ; A×B=(a₂b₃−a₃b₂,a₃b₁−a₁b₃,a₁b₂−a₂b₁); projB(A)=(A·B)B/|B|²
- Real Cartesian vectors with a common orthonormal basis. In 2D, z is zero; the cross product is reported in 3D. An angle involving a zero vector and projection onto a zero vector are undefined. The plot shows the XY projection.
A·B=Σaᵢbᵢ; A×B=(a₂b₃−a₃b₂,a₃b₁−a₁b₃,a₁b₂−a₂b₁); projB(A)=(A·B)B/|B|²A worked example
A=(1,2,3), B=(4,5,6): A·B=32; A×B=(−3,6,−3); angle≈12.933154°; projB(A)=(128,160,192)/77.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
Real Cartesian vectors with a common orthonormal basis. In 2D, z is zero; the cross product is reported in 3D. An angle involving a zero vector and projection onto a zero vector are undefined. The plot shows the XY projection.
Frequently asked questions
What does a negative dot product mean?
For nonzero vectors it means the angle is greater than 90 degrees.
Why does a 2D cross product have three components?
The two vectors are embedded in the XY plane with zero z components. Their cross product points along the z axis.
Why is an angle unavailable for a zero vector?
A zero vector has no direction. Its dot and cross products remain defined, but an angle with it does not.