Since they're not right triangles, using the dot product of the vectors may be easier.
Given the vectors (x1,y1) and (x2,y2):
angle in radians = arccos((x1*x2 + y1*y2) / ( sqrt(x1*x1 + y1*y1) * sqrt(x2*x2 + y2*y2) )
More wiki info here: http://en.wikipedia.org/wiki/Dot_product#Geometric_interpretation
Pretty decent vector algebra reference here:
http://emweb.unl.edu/math/mathweb/vectors/vectors.html#vec4
Edit: You may need to twiddle the signs a bit. I'm not a vector math genius and always have to "play" with the numbers a little.