-mathutils fix

* cos takes -1 to +1
This commit is contained in:
2005-10-10 17:57:53 +00:00
parent 7f62678571
commit 9b8868532a

View File

@@ -485,7 +485,7 @@ PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args)
dot += vec1->vec[x] * vec2->vec[x];
}
dot /= (sqrt(test_v1) * sqrt(test_v2));
CLAMP(dot,0.0f,1.0f);
CLAMP(dot,-1.0f,1.0f);
angleRads = (double)acos(dot);
return PyFloat_FromDouble(angleRads * (180 / Py_PI));