Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Gilbert <ascotan@gmail.com>2005-02-21 21:26:53 +0300
committerJoseph Gilbert <ascotan@gmail.com>2005-02-21 21:26:53 +0300
commit34b61ee4e98d68976db50af8353a279e7bb1953a (patch)
tree8e768c4c5b98fd09c8155e2f73de23a9ddc16847 /source/blender/python/api2_2x/Mathutils.c
parentc2e6ced9b8b65f54f23a68ef2c062f871783cc1a (diff)
-AngleBetweenVecs() was returning only 8-digit precision. This changes the precision to 16-digits and should fix some problems regarding spurious numbers being returned by python after running this function.
Diffstat (limited to 'source/blender/python/api2_2x/Mathutils.c')
-rw-r--r--source/blender/python/api2_2x/Mathutils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c
index e52997aecd8..910b1587974 100644
--- a/source/blender/python/api2_2x/Mathutils.c
+++ b/source/blender/python/api2_2x/Mathutils.c
@@ -371,10 +371,11 @@ static PyObject *M_Mathutils_AngleBetweenVecs( PyObject * self,
{
VectorObject *vec1;
VectorObject *vec2;
- float dot, angleRads, norm;
+ float norm;
+ double dot, angleRads;
int x;
- dot = 0;
+ dot = 0.0f;
if( !PyArg_ParseTuple
( args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2 ) )
return ( EXPP_ReturnPyObjError
@@ -412,10 +413,9 @@ static PyObject *M_Mathutils_AngleBetweenVecs( PyObject * self,
}
//I believe saacos checks to see if the vectors are normalized
- angleRads = saacos( dot );
+ angleRads = (double)acos( dot );
- return PyFloat_FromDouble( ( double )
- ( angleRads * ( 180 / Py_PI ) ) );
+ return PyFloat_FromDouble( angleRads * ( 180 / Py_PI ) );
}
static PyObject *M_Mathutils_MidpointVecs( PyObject * self, PyObject * args )