Skip to content
UniKit

Vector calculator

Work with 2D and 3D vectors: addition, subtraction, scalar multiplication, dot and cross products, magnitude, normalisation, angle, projection and scalar triple product, plus parallel, perpendicular and coplanar tests.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Vector input

Enter numbers separated by commas or spaces, e.g. “3, 4” or “1, 2, 3”.

Dimension

Result

Result11

What this tool does

  • Check linear algebra homework in one pass: dot product, cross product, triple product, unit vector and angle, without grinding through the intermediate steps.
  • Decide whether two direction vectors are parallel or perpendicular, or whether three vectors are coplanar (a zero scalar triple product means they are).
  • Find the component of a force along a given direction with the projection operation, which returns the projected vector directly.
  • Sanity-check graphics code: normalise a direction vector, measure the angle between two vectors and confirm which way a normal points.

Example

Input

2D, operation “Dot product a·b”, vector a = 3, 4, vector b = 1, 0

Output

Result 11

The dot product is 3×1 + 4×0 = 11. Switch the operation to “Projection of a onto b” and the same input yields (3, 0).

Frequently asked questions

Why is the cross product 3D only?

In 2D the cross product collapses to a scalar (a₁b₂ − a₂b₁, the signed area of the parallelogram), because there is no third component to point out of the plane. The tool implements the 3D cross product only and tells you so in 2D; use the parallel test for 2D instead.

Why do zero vectors fail the unit vector and angle operations?

A zero vector has no direction, so a/|a| divides by zero and cosθ = (a·b)/(|a||b|) becomes 0/0. Projection has the same problem: a zero target vector defines no direction to project onto.

How exact are the parallel, perpendicular and coplanar tests?

They use a length-independent relative tolerance of 1e-9: parallel checks |a×b| ≤ ε|a||b|, perpendicular checks |a·b| ≤ ε|a||b| and coplanar checks |a·(b×c)| ≤ ε|a||b||c|. Approximate inputs such as 0.333333 therefore do not flip the verdict through floating point noise.

What input format is expected?

Numbers separated by commas, spaces or semicolons, with a count matching the selected dimension — “3, 4” in 2D, “1, 2, 3” in 3D. A wrong count is reported as a format error instead of producing a wrong answer.

Is the angle in degrees or radians?

Both are shown. The angle is computed from cosθ = (a·b)/(|a||b|) in radians and converted to degrees, always in the 0°–180° range, so it is never negative.

Keywords:vector calculatordot productcross productvector magnitudevector projectionscalar triple product向量计算器点积叉积模长单位向量向量夹角

Related tools