InfyCalculator
➗

Vector Calculator

Enter two 2D or 3D vectors to get the dot product, cross product, magnitudes and the angle between them in degrees.

Vector A
Vector B
Loading calculator…

How it works

A · B = Σ aᵢbᵢ · A × B = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁) · |A| = √(Σ aᵢ²) · θ = arccos(A·B ÷ (|A||B|))

The dot product multiplies matching components and sums them; it is positive when vectors point the same general way, zero when they are perpendicular, and negative when opposed. The cross product (in 3D) returns a new vector perpendicular to both, with length equal to the area of the parallelogram they span — in 2D only its scalar z-component survives. Dividing the dot product by the two magnitudes gives the cosine of the angle between them, so arccos recovers that angle. The cosine argument is clamped to [−1, 1] to absorb rounding.

Worked example

For A = (1, 2, 3) and B = (4, 5, 6): the dot product is 1×4 + 2×5 + 3×6 = 32. The cross product is (2×6 − 3×5, 3×4 − 1×6, 1×5 − 2×4) = (−3, 6, −3). The magnitudes are √14 ≈ 3.742 and √77 ≈ 8.775, so the angle is arccos(32 ÷ (3.742 × 8.775)) ≈ arccos(0.9746) ≈ 12.93°.

Sources: Dot product — Wikipedia · Cross product — Wikipedia

Frequently asked questions

What does the dot product tell me?

It measures how aligned two vectors are. Zero means they are perpendicular; a positive value means the angle between them is acute; a negative value means it is obtuse. It’s the basis for projecting one vector onto another.

Why is the 2D cross product just a number?

The true cross product lives in 3D and points out of the plane. For 2D vectors the result is entirely along that out-of-plane z-axis, so only its scalar z-component matters — its size is the signed area of the parallelogram the two vectors form.

How is the angle between vectors found?

From the dot product: cos θ = (A · B) ÷ (|A| · |B|). Taking the inverse cosine gives θ. It needs both vectors to have nonzero length, otherwise the direction — and the angle — is undefined.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.