b2KIT

2D Vector Visualizer

Add, subtract, scale, and compute dot/cross products of 2D vectors visually. Shows projections and angle between vectors.

Tested tool guide Tested browser tools Checked August 16, 2026

What 2D Vector Visualizer does, with a checked example

Plot two vectors as arrows on a 2D grid and read off every standard result at once: the sum and difference, scalar multiples, the dot product, the cross product, the projection of one vector onto the other, and the angle between them. Edit any component and the drawing and the numbers update together. Two things catch people out. In 2D the cross product is a signed scalar, not a vector: its magnitude is the parallelogram area, and its sign tells which way the second vector turns from the first. And the reported angle is the smaller angle, 0 to 180 degrees, never the directed rotation.

Worked example

A concrete input and expected output from the current implementation.

Input

u = (3, 4) and v = (5, 2)

Expected output

u + v = (8, 6); u - v = (-2, 2); 2u = (6, 8); u . v = 23; u x v = -14; |u| = 5; |v| = 5.39; projection of v onto u = (2.76, 3.68); angle between u and v = 31.3 degrees

The dot product is 3(5) + 4(2) = 23 and the 2D cross product is 3(2) - 4(5) = -14, negative because v lies clockwise from u (u points at 53.1 degrees, v at 21.8 degrees). The angle follows from cos(angle) = 23 / (5 x 5.39) = 0.854, which gives 31.3 degrees.

How the result is produced

1

Coordinate definitions drive every result

Each vector is entered as an (x, y) pair, and every displayed quantity comes from the coordinate formulas: addition and subtraction are component-wise, a scalar multiple scales both components, the dot product is x1x2 + y1y2, the cross product is x1y2 - y1x2, and the length of u is sqrt(x^2 + y^2). All results derive from the same two pairs of numbers, so they stay consistent as you edit.

2

Angle and projection

The angle comes from cos(angle) = (u . v) / (|u| |v|), which always returns the smaller angle, 0 to 180 degrees; perpendicular vectors give exactly 90 degrees. The projection of v onto u is ((v . u) / |u|^2) u, the component of v along u's direction, shown as an arrow on the line of u. Projection is not symmetric: swapping u and v changes the result.

Good uses

  • Checking homework or a published figure: recompute a sum, dot product, or angle you derived by hand, and see the arrows to confirm the result and the quadrant.
  • Breaking a force, velocity, or displacement into parts along a chosen direction: the projection gives the component of one vector along another, for example how much of a force pushes along a slope rather than into it.
  • Deciding whether two directions are perpendicular (dot product 0), parallel (cross product 0), or which side of one vector's line the other lies on (sign of the cross product), useful for orientation and winding-order checks.

Limits and checks

  • The 2D cross product is a single signed number, not a vector: its magnitude is the area of the parallelogram spanned by the two vectors, and there is no direction component to interpret.
  • The angle readout is the smaller angle, 0 to 180 degrees. It cannot express the directed rotation from u to v; use the sign of the cross product for direction, negative meaning clockwise from the first vector to the second.
  • Projection is directional: the projection of v onto u differs from the projection of u onto v unless the vectors have equal length. Check which vector you projected before reading the result.

Common questions

Why is the cross product a single number and not a vector?

In 2D the cross product is the signed z-component of the 3D cross product, so it collapses to one value: x1y2 - y1x2. Its absolute value equals the area of the parallelogram spanned by the two vectors, and its sign tells whether the second vector lies clockwise or counterclockwise from the first. A true vector cross product requires vectors in 3D space.

The angle is always between 0 and 180 degrees. Can I see the directed angle from u to v?

No. The angle display shows the smaller angle between the two vectors and cannot represent the direction of rotation. Combine it with the cross product sign instead: if u x v is positive, rotating u counterclockwise by that angle reaches v; if negative, rotate clockwise.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools