Skip to content
uencoder

Vector

A vector is a quantity with magnitude and direction, represented as an ordered array of numbers, supporting addition, scalar multiplication, dot products, and cross products; it is the foundation of physics and geometry.

Purpose

To represent and manipulate directed quantities, the basis of linear algebra, physics, and graphics.

Mechanism

An n-dimensional vector [v1,...,vn]. Addition and subtraction are component-wise. Scalar multiplication scales every component. Dot product a·b=Σa_i×b_i (a projection). Cross product is 3D only, with the result perpendicular to both inputs. Norm |v|=√(Σv_i²); unit vector v/|v|.

Use cases

  • 3D graphics and physics
  • Machine learning feature vectors
  • Force and velocity computation
  • Vector space retrieval

Examples

  • Input
    [1,2] · [3,4] = 1×3+2×4
    Output
    11

    Dot product

Common errors

Confusing the dot product with the cross product
The dot product yields a scalar; the cross product yields a vector (3D only)

Related terms

Related tools

References