   acos?
  wat is acos()?? 
  It takes the cosine of an angle (in radians), and returns the actual angle (also in radians).  It is also called the inverse cosine.  In the future people are going to tell you to look here or somewhere else: msdn.microsoft.com ;  So sorry, but how does this function work?returnAngleBetweenVectors(vector v1,vector v2){    float dot = dotProduct(v1,v2);    float mag = v1.Magnitude() * v2.Magnitude();    float angle = (float)acos(dot/mag);    return(angle);};  No problem, I do not mind, I''m just warning you that some people will get anal about not searching for ''easy'' answers...I personally don''t care.Anyway, the dotproduct between two normalized vectors is equal to the cosine of the angle in radians.  If one or both of the vectors does not have a length of one, then the cosine of the angle is equal to:cosine = DotProduct(Vector1,Vector2) / (Vector1.length * Vector2.length);This can actually be proved by using the cosine law.  So, once you have the cosine of the angle, the angle itself is given by acos(cosine), which is again in radians.  ;  Thankyou!!so if the vectors are normalized we can just godot = dotProduct(v1,v2);angle = acos(dot);;  You got it chief.EDIT:And remember it's in radians!  [edited by - Shadow12345 on February 18, 2004 8:05:00 PM];  The cosine of an angle does not matter if the angle was in radians or degrees, it will be the same value regardless as it has no units.  Now the acos DOES return radians and this is important.  I know a little bit nit picky, but if the OP didnt know what acos was, then I thought it might be necessary to make that correction.;quote:Original post by Muncher  So sorry, but how does this function work?returnAngleBetweenVectors(vector v1,vector v2){    float dot = dotProduct(v1,v2);    float mag = v1.Magnitude() * v2.Magnitude();    float angle = (float)acos(dot/mag);    return(angle);} That function works badly for small angles.Damn,i think,it''s better to search and necro.(this topic(acos,angle between vectors,etc) are posted here 3 times a week!).In any other forum necro are allowed. 