this may help you :
if you have two vectors, the dotproduct of the normalized vectors ( length is 1 ) of both ( dotproduct is sum over the products of the components x(i)y(i) ) is the cosine of the angle
the cool thing about it is that this simple stuff is working in n-dimensional vector spaces

( at least on kanonical bases )
€ : argh, what did I write
€^2: LA sucks btw ... at least the nontrivial stuff ... but somewhen you'll call everything trivial, so there is still hope