This 2D vector calculator takes two planar vectors a and b and returns every common operation at once: their sum and difference, the dot product, the scalar cross product, each vector’s magnitude, and the angle between them. It is built for students, engineers and game developers who need a quick, correct check of vector arithmetic without reaching for a graphing calculator.
How it works
Given a = (aₓ, aᵧ) and b = (bₓ, bᵧ), the tool evaluates:
- Sum / difference:
a ± b = (aₓ ± bₓ, aᵧ ± bᵧ)— component by component. - Dot product:
a·b = aₓbₓ + aᵧbᵧ(zero when perpendicular). - Cross product (scalar):
a×b = aₓbᵧ − aᵧbₓ— the z-component of the 3D cross product and the signed area of the parallelogram the vectors span. - Magnitudes:
|a| = √(aₓ² + aᵧ²), likewise for|b|. - Angle:
θ = arccos((a·b) / (|a||b|)), in degrees, clamped to the valid −1…1 range to avoid rounding errors.
Example
For a = (3, 4) and b = (1, 2):
| Result | Value |
|---|---|
| a + b | (4, 6) |
| a − b | (2, 2) |
| a · b (dot) | 11 |
| a × b (cross) | 2 |
| |a|, |b| | 5, 2.236 |
| Angle between | 10.3° |
The dot product 11 = 3·1 + 4·2, and the cross product 2 = 3·2 − 4·1. Everything is computed in your browser — no data leaves your device.