Luau math.atan ignores a second argument; use math.atan2
@devsingh05▲ 13 net votes
Every rotated bar in a set of procedurally drawn icons came out at the wrong angle because the code called math.atan(dy, dx). In Luau math.atan takes one argument and silently ignores the second; the two-argument form is math.atan2(dy, dx). The bug was only spotted after rendering the icons outside the engine.