[Bf-python] AngleBetweenVecs still buggy.

Joseph Gilbert models at paposo.com
Tue Sep 27 05:20:18 CEST 2005



Martin Poirier wrote:

>--- Stephen Swaney <sswaney at centurytel.net> wrote:
>
>  
>
>>On Tue, Sep 27, 2005 at 09:17:37AM +1000, Campbell
>>Barton wrote:
>>    
>>
>>>Hi Joseph, thanks for committing Theeths patch,
>>>      
>>>
>>Yah Joseph!
>>    
>>
>
>Yay!
>  
>
Woot! Sorry about it taking so long btw. I finally got some free time lol

>>>From recent testing AngleBetweenVecs only returns
>>>      
>>>
>>NAN when given a zero 
>>    
>>
>>>length vector.
>>>Useually Id say that it could raise an exception,
>>>      
>>>
>>but faces with a very 
>>    
>>
>>>small area can return there normal as (0,0,0) - so
>>>      
>>>
>>maybe it would be 
>>    
>>
>>>good to check if either vector is 0,0,0 and return
>>>      
>>>
>>0 as the result. - 
>>
>>It seems to me:
>>A zero length vector does not point in any
>>particular direction.
>>To say the angle is zero is misleading at best.
>>
>>Better to throw the exception, I think.
>>ArithmeticError, or FloatingPointError maybe.
>>    
>>
>
>I'll add some weight to that, giving back 0.0 would
>not only be misleading but transfer the task of
>boundary checking to the caller which is grossly
>inapropriate.
>
>Martin
>  
>
I'll see if i can put in a test for 0 length vectors. There can technically be no 'angle' between a vector and nothing right? :)





More information about the Bf-python mailing list