Vector Operations

v[[i]] or Part[v,i]give the i^(th) element in the vector v
c vscalar multiplication of c times the vector v
u.vdot 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]:=
Click for copyable input
Out[1]=
This gives a vector in the direction opposite to with twice the magnitude.
In[2]:=
Click for copyable input
Out[2]=
This reassigns the first component of to be its negative.
In[3]:=
Click for copyable input
Out[3]=
This gives the dot product of and .
In[4]:=
Click for copyable input
Out[4]=
This is the norm of .
In[5]:=
Click for copyable input
Out[5]=
This is the unit vector in the same direction as .
In[6]:=
Click for copyable input
Out[6]=
This verifies that the norm is 1.
In[7]:=
Click for copyable input
Out[7]=
Transform to have zero mean and unit sample variance.
In[8]:=
Click for copyable input
Out[8]=
This shows the transformed values have mean 0 and variance 1.
In[9]:=
Click for copyable input
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]:=
Click for copyable input
Out[10]=
is a scalar multiple of .
In[11]:=
Click for copyable input
Out[11]=
is orthogonal to .
In[12]:=
Click for copyable input
Out[12]=
Starting from the set of vectors , this finds an orthonormal set of two vectors.
In[13]:=
Click for copyable input
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]:=
Click for copyable input
Out[14]=