diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-03-27 17:15:59 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-03-27 17:15:59 (EDT) |
commit | 02c198574420b8832c4bf9741f38e1928a346286 (patch) | |
tree | 36e82227f3cc2107b971b91af2faf4e672646953 /src | |
parent | ad5bb828321f7a4f0fe15a4505f1c85a7e1acc04 (diff) | |
download | dodge-balls-02c198574420b8832c4bf9741f38e1928a346286.zip dodge-balls-02c198574420b8832c4bf9741f38e1928a346286.tar.gz dodge-balls-02c198574420b8832c4bf9741f38e1928a346286.tar.bz2 |
ball: Fix floating-point remainder arithmetic
Diffstat (limited to 'src')
-rw-r--r-- | src/ball.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -101,7 +101,7 @@ _db_ball_bounce(struct db_ball *ball, double col_x, double col_y) double col_a; col_a = atan2(col_y - ball->y, col_x - ball->x) * 180 / M_PI; - ball->a = (2 * col_a - ball->a - 180) % 360; + ball->a = fmod(2 * col_a - ball->a - 180, 360); } void |