lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Rena <hyperhacker@gmail.com> writes:
> I just discovered that math.atan2 doesn't handle the case of y=0
> properly, at least in Lua 5.1:
>
>> a, b = {-1, 0}, {1, 0}
>> =math.deg(math.atan2(b[2] - a[2], b[1] - a[1]))
> 0

That is the correct result.

Anyway, Lua's atan2 just calls the C library's atan2, so if you notice
any problem, it's more likely to be with the C library.

-Miles

-- 
gravity a demanding master ... soft soft snow