BruceSherwood/vpython-wx

diff_angle sometimes returns nan

BruceSherwood opened this issue · 1 comments

As reported by Geoff Tovey, the following test prints 6 of the 100 results of diff_angle involving two nearly equal vectors as "nan":

a = vector(1,2,3)
for i in range(1,100,1):
b = vector(1,2,3+.000001/i)
print(diff_angle(a,b))

I've fixed this in vector.cpp and tested it. Kevin Karplus provided useful analysis of the issue.