Vector Calculator

Calculate magnitude, dot product, cross product and angle between vectors.

Result

Write vectors in angle brackets, like <3, 4> or u = <1, 2, 3>, then say what to find: magnitude, unit vector, dot, cross, angle, projection.

Enter vectors to get the magnitude and unit vector (|⟨3, 4⟩| = 5, unit vector ⟨0.6, 0.8⟩), the dot product and the angle between them, the cross product of 3D vectors, or the projection of one onto another – with the formula behind each answer.

Vector formulas

QuantityFormulaMeaning
Magnitude|\mathbf{u}| = \sqrt{u_1^2 + u_2^2 + u_3^2}Length of the arrow
Unit vector\hat{\mathbf{u}} = \frac{\mathbf{u}}{|\mathbf{u}|}Same direction, length 1
Dot product\mathbf{u} \cdot \mathbf{v} = u_1v_1 + u_2v_2 + u_3v_3A number; 0 means perpendicular
Angle\cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{|\mathbf{u}||\mathbf{v}|}Between 0° and 180°
Projection\operatorname{proj}_{\mathbf{v}}\mathbf{u} = \frac{\mathbf{u} \cdot \mathbf{v}}{|\mathbf{v}|^2}\mathbf{v}The part of u along v
Cross product\mathbf{u} \times \mathbf{v} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ u_1 & u_2 & u_3 \\ v_1 & v_2 & v_3 \end{vmatrix}Perpendicular to both (3D only)

Example: the angle between \langle 1, 0 \rangle and \langle 1, 1 \rangle

\cos\theta = \frac{1 \cdot 1 + 0 \cdot 1}{1 \cdot \sqrt{2}} = \frac{\sqrt{2}}{2} \;\Rightarrow\; \theta = 45^{\circ}

Example: the cross product of \langle 1, 2, 3 \rangle and \langle 4, 5, 6 \rangle – cover each column in turn:

\langle 2 \cdot 6 - 3 \cdot 5,\ 3 \cdot 4 - 1 \cdot 6,\ 1 \cdot 5 - 2 \cdot 4 \rangle = \langle -3,\ 6,\ -3 \rangle

Its length, \sqrt{9 + 36 + 9} = 3\sqrt{6} \approx 7.35, is the area of the parallelogram the two vectors make. Check: the dot product of the answer with each input is 0, so it is perpendicular to both. Open it in the calculator.

Example: project \langle 2, 3 \rangle onto \langle 1, 1 \rangle: the dot product is 5 and |\langle 1, 1 \rangle|^2 = 2, so the projection is \tfrac{5}{2}\langle 1, 1 \rangle = \langle 2.5,\ 2.5 \rangle – the shadow of the first vector along the line of the second.

Vectors in physics

  • Work is a dot product: W = F · d. Pulling a sledge 10 m with 50 N at 30° to the ground does 50 \times 10 \times \cos 30^\circ \approx 433 J – only the part of the force along the path counts.
  • Torque is a cross product: τ = r × F, which is why a longer spanner turns a nut more easily.
  • Resultants are sums: forces of ⟨3, 0⟩ N and ⟨0, 4⟩ N together act like one force of 5 N.

Parallel or not? Two vectors are parallel when one is a multiple of the other (⟨2, 4, 6⟩ = 2⟨1, 2, 3⟩); in 3D their cross product is then the zero vector.

Dot product or cross product?

  • The dot product gives a number. It measures how much two vectors point the same way, and gives the angle between them and projections.
  • The cross product gives a vector perpendicular to both, with length equal to the area of the parallelogram they span. It exists only in three dimensions, and \mathbf{u} \times \mathbf{v} = -(\mathbf{v} \times \mathbf{u}).

For matrices – determinants, inverses and row reduction – use the matrix calculator.

Frequently asked questions

How do you know if two vectors are perpendicular?

Their dot product is 0. For example ⟨2, 1⟩ · ⟨−1, 2⟩ = −2 + 2 = 0.

Can I use square roots in a vector?

Yes – type sqrt(2) or √2 as a component. The answers keep square roots exact where possible.

Why does the cross product need 3D vectors?

The cross product gives a vector perpendicular to both inputs, which only makes sense in three dimensions. For 2D vectors you can add a 0 as the third component.