[attachment=6642:angle.png]
I have the vectors V[sub]a , [/sub]V[sub]b[/sub] and V[sub]o[/sub] (the intresect point).
I've been searching for almost a week but i cannot get the math right so now i'm asking for your help. (this includes the gamedev forums)
This is the code i've been playing around with.
private double AngleBetweenVectors(Vector2 o, Vector2 a, Vector2 b)
{
Vector2 Va = Vector2.Subtract(a, o), Vb = Vector2.Subtract(b, o); // differenses
double result = 0;
double angle;
//result = (Math.Atan2(t1.Y, t1.X) - Math.Atan2(t2.Y, t2.X)) * 180 * Math.PI;
angle = -(180/Math.PI)*Math.Atan2(Va.X*v2.Y - Vb.Y*Vb.X, Va.X*Vb.X+Va.Y*Vb.Y);
forShowingDataLong = (long)angle;
return result;
}