[Bf-committers] Mesh-Tools in 2.36?

Mal mal at candomultimedia.com
Tue Nov 30 21:43:38 CET 2004


Is there a reason that there isn't a function called 
getAngleBetween2Vectors in the Blender maths library ( as well as 
several other utility functions )?

If they were built in, it would mean that a lot of different coders 
wouldn't have to rewrite relatively simple ( unless you get the formulae 
wrong of course ) functions, and could focus on the real work of 
implementing new features.

Mal

>> How do you find the angle between two vectors?  I
>> found a python function that does this, can you call
>> python functions from c?
>>  
>>
> I believe that that would be the arc cosine of the dot product of the 
> vectors.  So, I think that would be:
>
> Angle = acos(v1[0] * v[0] + v1[1] * v2[1] + v1[2] + v2[2])
>
> . . .where v1 and v2 are vectors.  This is of course in radians, so to 
> convert to degrees you would do this:
>
> Degree = Angle * 180 / PI (I think).
>
> Remember that the dot product of two normalized (where length=1) 
> vectors is equal to the cosine between them.
>
> joeedh
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>



More information about the Bf-committers mailing list