[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Atan2 and angle between vectors
- From: Miles Bader <miles@...>
- Date: Tue, 03 Apr 2012 13:40:44 +0900
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