v = vector([2,1])
w = vector([1,2])
x = sqrt(2*2+1*1)
y = sqrt(1*1+2*2)
cos(theta) = v*w /(x*y)
print cos(theta)