MATHEMATICA GUIDE

# Operations on Vectors

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

## ReferenceReference

### 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

### Elements of Vectors

Length number of elements in a vector

Part extract an element of a vector ()

Set reset an element of a vector ()

VectorQ test whether an expression is a vector

### Mathematical Operations

+, *, ^, ... automatically element-wise:

Dot (.) scalar dot product

Cross () vector cross product (entered as EsccrossEsc)

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 Gram-Schmidt 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 »

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