[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Code: Center of Triangle
Hi!
I think he meant to take the square root. That would be the distance, which is the vector result of a 3 dimensional image...
DR0ID wrote:
> Hi
>
>> def CalculateDistance(a, b):
>> x, y, z = b[0] - a[0], b[1] - a[1], b[2] - a[2]
>> dist = x*x + y*y + z*z
>> return dist * dist
>>
>
> no offense, but "x*x + y*y + z*z" is already the distance squared, so
> no need for "return dist*dist". (or did you do this on purpose?).
>
> ~DR0ID
>
>
Uh, yeah, good catch. :-)