Vector calculator (2D/3D)

All results: Sum · Difference · Dot product · Cross product A × B (3D) · Unit vector A / |A|

Sum
—
Difference
—
Dot product
—
|A|
—
|B|
—
Angle between (°)
—
Cross product A × B (3D)
—
|A × B|
—
Unit vector A / |A|
—

Use a decimal point. Active components have absolute value ≤ 10¹² and reduced decimal denominator ≤ 10²⁴. Inactive components are ignored. In 2D, z=0; A × B is the 3D vector perpendicular to the xy plane, not a 2D vector. Magnitude and normalization use only A; other operations use A and B. Component arithmetic and dot/cross products use exact fractions before display rounding. Results are approximate to 12 significant digits. The angle uses atan2(|A × B|, A·B) to preserve small angles.

Operation (2D/3D)

A ± B = (aᵢ ± bᵢ); A·B = Σaᵢbᵢ; |A| = √Σaᵢ²; A × B = (aᵧb𝓏−a𝓏bᵧ, a𝓏bₓ−aₓb𝓏, aₓbᵧ−aᵧbₓ); Â = A/|A|

Use a decimal point. Active components have absolute value ≤ 10¹² and reduced decimal denominator ≤ 10²⁴. Inactive components are ignored. In 2D, z=0; A × B is the 3D vector perpendicular to the xy plane, not a 2D vector. Magnitude and normalization use only A; other operations use A and B. Component arithmetic and dot/cross products use exact fractions before display rounding. Results are approximate to 12 significant digits. The angle uses atan2(|A × B|, A·B) to preserve small angles.

The zero vector has length zero but no unit direction. The angle is undefined if either vector is zero. A zero dot product implies perpendicularity only when both vectors are nonzero.

Frequently asked questions

What happens with a zero vector?

The zero vector has length zero but no unit direction. The angle is undefined if either vector is zero. A zero dot product implies perpendicularity only when both vectors are nonzero.

How we verified this calculator

The calculator is checked against 2 reference cases computed independently of its code. Last passed: .

# Inputs Expected result
1
Dimension = 2D
Operation = Dot product
Ax = 3
Ay = 4
Bx = 1
By = 2
Dot product: 11
2
Dimension = 3D
Operation = Dot product
Ax = 3
Ay = 4
Az = 12
Bx = 1
By = 2
Bz = 3
Dot product: 47

How we test our calculators →

Also try:

Back to category →