# Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
WOLFRAM LANGUAGE TUTORIAL

# Vector Operations

 v[[i]] or Part[v,i] give the i element in the vector v c v scalar multiplication of c times the vector v u.v dot product of two vectors Norm[v] give the norm of v Normalize[v] give a unit vector in the direction of v Standardize[v] shift v to have zero mean and unit sample variance Standardize[v,f1] shift v by and scale to have unit sample variance

Basic vector operations.

This is a vector in three dimensions.
 In[1]:=
 Out[1]=
This gives a vector in the direction opposite to with twice the magnitude.
 In[2]:=
 Out[2]=
This reassigns the first component of to be its negative.
 In[3]:=
 Out[3]=
This gives the dot product of and .
 In[4]:=
 Out[4]=
This is the norm of .
 In[5]:=
 Out[5]=
This is the unit vector in the same direction as .
 In[6]:=
 Out[6]=
This verifies that the norm is 1.
 In[7]:=
 Out[7]=
Transform to have zero mean and unit sample variance.
 In[8]:=
 Out[8]=
This shows the transformed values have mean 0 and variance 1.
 In[9]:=
 Out[9]=

Two vectors are orthogonal if their dot product is zero. A set of vectors is orthonormal if they are all unit vectors and are pairwise orthogonal.

 Projection[u,v] give the orthogonal projection of u onto v Orthogonalize[{v1,v2,…}] generate an orthonormal set from the given list of vectors

Orthogonal vector operations.

This gives the projection of onto .
 In[10]:=
 Out[10]=
is a scalar multiple of .
 In[11]:=
 Out[11]=
is orthogonal to .
 In[12]:=
 Out[12]=
Starting from the set of vectors , this finds an orthonormal set of two vectors.
 In[13]:=
 Out[13]=
When one of the vectors is linearly dependent on the vectors preceding it, the corresponding position in the result will be a zero vector.
 In[14]:=
 Out[14]=