Operations on Vectors

The Wolfram Language represents vectors as lists, and never needs to distinguish between row and column cases. Vectors in the Wolfram Language can always mix numbers and arbitrary symbolic or algebraic elements. The Wolfram Language uses state-of-the-art algorithms to bring platform-optimized performance to operations on extremely long, dense, and sparse vectors.

Constructing Vectors

Table construct a vector from an expression

Array construct a vector from a function

ConstantArray construct a vector of constants

SparseArray construct a sparse vector from positions and values

AngleVector  ▪  FromPolarCoordinates  ▪  CirclePoints

Elements of Vectors

Length number of elements in a vector

Part extract an element of a vector (v[[i]])

Set reset an element of a vector (v[[i]]=x)

VectorQ test whether an expression is a vector

Mathematical Operations

+, *, ^, ... automatically element-wise: {a,b}+{c,d}{a+c,b+d}

Dot (.) scalar dot product

Cross () vector cross product (entered as cross)

Norm norm of a vector

Total total of elements in a vector

Div divergence

Curl curl in any dimension

Vector Space Operations

VectorAngle angle between two vectors

UnitVector unit vector along a coordinate direction

Normalize normalize a vector to unit length

Projection find the projection of one vector on another

Orthogonalize find a GramSchmidt orthonormal basis

KroneckerProduct Kronecker outer product

Displaying Vectors

Row, Column display in row or column form

Arrow represent an arrow in a graphic

Vector Distance Measures »

EuclideanDistance  ▪  ManhattanDistance  ▪  ...

DistanceMatrix matrix of pairwise distances

Grad, D derivatives of vectors of functions and functions of vectors

Thread force any function to thread over lists

Symbolic Vectors

Indexed represent a symbolically indexed vector