Math-Get Angle between two vectors

From Vectorlab
Jump to: navigation, search


Returns the angle between two vectors. By Orso B. Schmid


{ Orso ***************************** }
{ returns the angle between two vectors }
FUNCTION M_GetAngle2Vec(v1, v2: VECTOR): REAL;
	BEGIN
		M_GetAngle2Vec := Rad2Deg(ArcCos(DotProduct(
			UnitVec(v1), UnitVec(v2)
			)));
	END;