View Full Version : easiest way to find angle btween 2 points?

07-06-2000, 09:54 AM
Can someone give me the solution in simple trig?

07-06-2000, 01:26 PM
Two points constitute a line, but however if you are talking about two vectors from the origin, then we can find the angle between those VECTORS.

GLfloat findangle(vector one, vector two)
GLfloat dotproduct=one.x*two.x + one.y*two.y + one.z*two.z;
GLfloat cosangle(dotproduct/(one.length*two.length));
return acos(cosangle);