[Bf-python] Mathutils additions

jms jmsoler at free.fr
Sat Jul 17 13:37:43 CEST 2004


guignot wrote:

>Le Samedi 17 Juillet 2004 12:03, Campbell Barton a écrit :
>  
>
>>Hi, The method is as follows in C
>>
>>        length = sqrt(pow((v2[0] - v1[0]),2) + pow((v2[1] - v1[1]),2) +
>>pow((v2[2] - v1[2]),2) );
>>    
>>
>
>Try to avoid pow(x,2), it is too long.
>
>x*x is much faster!
>
>
>  
>

x=2.0
n=2.0
 x**n

for  pow(x,n)
and:

x=2.0
n=0.5
 x**n

for  sqrt(2.0)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20040717/6589a789/attachment.html>


More information about the Bf-python mailing list