Vector Calculator

Add vectors, find magnitude and direction, and compute dot, cross, and unit vectors step by step
Resultant of (3, -4) and (-1, 7)
Components of a vector with magnitude 20 at 35 degrees
Cross product of (1, 2, 3) and (4, 5, 6)
Unit vector in the direction of (6, -8)

Vector Basics: Components, Magnitude, Direction

A vector carries both magnitude and direction. In component form v=(v1,v2)\vec{v} = (v_1, v_2) or (v1,v2,v3)(v_1, v_2, v_3).

Magnitude (length) is the distance formula applied to the components:

v=v12+v22v=v12+v22+v32\|\vec{v}\| = \sqrt{v_1^2 + v_2^2} \qquad \|\vec{v}\| = \sqrt{v_1^2 + v_2^2 + v_3^2}

Direction angle in 2D, measured counter-clockwise from the positive xx-axis:

θ=arctan ⁣(v2v1), then add 180 if v1<0\theta = \arctan\!\left(\frac{v_2}{v_1}\right), \text{ then add } 180^\circ \text{ if } v_1 < 0

Back to components from magnitude rr and direction θ\theta:

v1=rcosθ,v2=rsinθv_1 = r\cos\theta, \qquad v_2 = r\sin\theta

Unit vector — same direction, length 1:

v^=vv\hat{v} = \frac{\vec{v}}{\|\vec{v}\|}

This is defined only for v0\vec{v} \ne \vec{0}. Two vectors are equal when their components match; position on the page is irrelevant.

Adding Vectors and the Two Products

Addition and the resultant

Add component by component:

u+v=(u1+v1,  u2+v2)\vec{u} + \vec{v} = (u_1 + v_1,\; u_2 + v_2)

The sum is the resultant — the single vector with the same effect as applying both. Scalar multiplication kv=(kv1,kv2)k\vec{v} = (kv_1, kv_2) scales the length by k|k| and reverses direction when k<0k < 0. Subtraction is uv=u+(v)\vec{u} - \vec{v} = \vec{u} + (-\vec{v}).

A warning that costs marks: u+vu+v\|\vec{u} + \vec{v}\| \ne \|\vec{u}\| + \|\vec{v}\| unless the vectors point the same way. Always add components first, then take the magnitude.

Dot product — output is a scalar

uv=u1v1+u2v2+u3v3=uvcosθ\vec{u}\cdot\vec{v} = u_1v_1 + u_2v_2 + u_3v_3 = \|\vec{u}\|\|\vec{v}\|\cos\theta

Zero means perpendicular. Used for angles, projections, and work.

Cross product — output is a vector, 3D only

u×v=(u2v3u3v2,  u3v1u1v3,  u1v2u2v1)\vec{u}\times\vec{v} = (u_2v_3 - u_3v_2,\; u_3v_1 - u_1v_3,\; u_1v_2 - u_2v_1)

The result is perpendicular to both inputs, which is how you get a normal vector to a plane. Its length uvsinθ\|\vec{u}\|\|\vec{v}\|\sin\theta equals the area of the parallelogram they span, and order matters: v×u=(u×v)\vec{v}\times\vec{u} = -(\vec{u}\times\vec{v}).

Common Mistakes to Avoid

  • Adding magnitudes instead of components. Two forces of 5 at right angles give a resultant of 507.07\sqrt{50} \approx 7.07, not 10.
  • Ignoring the quadrant in arctan\arctan. A calculator returns (90,90)(-90^\circ, 90^\circ) only, so (3,4)(-3, -4) and (3,4)(3, 4) produce the same raw output. Check the signs of the components and add 180180^\circ when v1<0v_1 < 0.
  • Confusing the two products. The dot product returns a number; the cross product returns a vector and exists only in 3D.
  • Reversing the cross product. Each component uses the other two indices in cyclic order, and the middle term u3v1u1v3u_3v_1 - u_1v_3 is the one most often written backwards.
  • Forgetting to normalise. A "unit normal" must be divided by its own magnitude — a raw cross product is rarely of length 1.
  • Mixing 2D and 3D. The cross product is undefined for two 2D vectors; embed them as (u1,u2,0)(u_1, u_2, 0) first if you need it.

示例题目

Step 1: Add components: u+v=(3+(1),  4+7)=(2,3)\vec{u} + \vec{v} = (3 + (-1),\; -4 + 7) = (2, 3)
Step 2: Magnitude: 22+32=4+9=133.606\sqrt{2^2 + 3^2} = \sqrt{4 + 9} = \sqrt{13} \approx 3.606
Step 3: Direction: θ=arctan(3/2)=arctan(1.5)56.31\theta = \arctan(3/2) = \arctan(1.5) \approx 56.31^\circ
Step 4: Both components are positive, so the resultant lies in quadrant I — no adjustment needed
Answer: u+v=(2,3)\vec{u}+\vec{v} = (2,3), u+v=133.61\|\vec{u}+\vec{v}\| = \sqrt{13} \approx 3.61 at 56.3156.31^\circ

Step 1: v1=rcosθ=20cos35v_1 = r\cos\theta = 20\cos 35^\circ
Step 2: cos350.81915\cos 35^\circ \approx 0.81915, so v1=20×0.81915=16.383v_1 = 20 \times 0.81915 = 16.383
Step 3: v2=rsinθ=20sin35v_2 = r\sin\theta = 20\sin 35^\circ, and sin350.57358\sin 35^\circ \approx 0.57358
Step 4: v2=20×0.57358=11.472v_2 = 20 \times 0.57358 = 11.472
Step 5: Check: 16.3832+11.4722=268.4+131.6=400=20\sqrt{16.383^2 + 11.472^2} = \sqrt{268.4 + 131.6} = \sqrt{400} = 20
Answer: v(16.38,  11.47)\vec{v} \approx (16.38,\; 11.47)

Step 1: First component: u2v3u3v2=2(6)3(5)=1215=3u_2v_3 - u_3v_2 = 2(6) - 3(5) = 12 - 15 = -3
Step 2: Second component: u3v1u1v3=3(4)1(6)=126=6u_3v_1 - u_1v_3 = 3(4) - 1(6) = 12 - 6 = 6
Step 3: Third component: u1v2u2v1=1(5)2(4)=58=3u_1v_2 - u_2v_1 = 1(5) - 2(4) = 5 - 8 = -3
Step 4: So u×v=(3,6,3)\vec{u}\times\vec{v} = (-3, 6, -3)
Step 5: Magnitude: 9+36+9=54=367.348\sqrt{9 + 36 + 9} = \sqrt{54} = 3\sqrt{6} \approx 7.348
Step 6: Unit normal: (3,6,3)36=(1,2,1)6(0.408,0.816,0.408)\dfrac{(-3,6,-3)}{3\sqrt{6}} = \dfrac{(-1,2,-1)}{\sqrt{6}} \approx (-0.408,\, 0.816,\, -0.408)
Answer: u×v=(3,6,3)\vec{u}\times\vec{v} = (-3,6,-3), unit normal (0.408,0.816,0.408)\approx (-0.408,\, 0.816,\, -0.408)

常见问题

Square every component, add the squares, and take the square root: ‖v‖ = √(v₁² + v₂² + v₃²). It is the distance formula applied to the components, so the magnitude is always non-negative and equals zero only for the zero vector.

The resultant is the sum of two or more vectors — the single vector that has the same combined effect. Add corresponding components to find it, then take the magnitude of that sum if you need its size. Adding the individual magnitudes instead gives the wrong answer whenever the vectors point in different directions.

The dot product multiplies matching components and returns a single number, measuring how much two vectors point the same way; it is zero for perpendicular vectors. The cross product returns a vector perpendicular to both inputs, exists only in 3D, and its length equals the area of the parallelogram the two vectors span.

Take two non-parallel vectors lying in the plane — often built by subtracting three known points — and compute their cross product. The result is perpendicular to both, hence normal to the plane. Divide by its magnitude if you need a unit normal.

相关求解器

相关学习指南

免费试用 AI-Math

任何数学问题都能获得分步解答。拍照上传或输入问题即可。

开始解题