mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Fix error Stac caught in sin_lookup
This commit is contained in:
parent
8eac518a9c
commit
d6c485459f
@ -101,9 +101,9 @@ float sin_lookup_deg(float angle)
|
||||
return 0;
|
||||
|
||||
int i_ang = ((int32_t) angle) % 360;
|
||||
if (i_ang > 180) // for 180 to 270 deg
|
||||
if (i_ang >= 180) // for 180 to 360 deg
|
||||
return -sin_table[i_ang - 180];
|
||||
else // for 0 to 90 deg
|
||||
else // for 0 to 179 deg
|
||||
return sin_table[i_ang];
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user