title: Xbox360 Analog stick angle SDL
body: <p>Okay, straight to the point I'm working on a game engine in C++ using SDL and openGL with lua scripting and I need to get the angle of the analog stick to determine the direction of the 2d gun using this lua code</p>
  
  <pre><code>playerLookArrow.rotation = math.atan(logic:controllerAxisForce(3)/-logic:controllerAxisForce(4))
  </code></pre>
  
  <p>logic:controllerAxisForce(int AXIS) returns</p>
  
  <pre><code>SDL_JoystickGetAxis(Joystick, AXIS);
  </code></pre>
  
  <p>The problem is that my gun will only point to the left instead of left and right.</p>