title: Sprite rotation is not working fine LibGDX
body: <p>I'am using the current mouse position to aim the player sprite, but I am not getting the best results. I want my sprite to have the direction pointed wherever my cursor is in the screen. Here's the result I want to get. (When I move my mouse jet rotates slowly)<img src="https://i.stack.imgur.com/sETQq.png" alt="enter image description here"></p>
  
  <p>But this is what I get: 1) when my mouse position y = 0 jet sprite rotates very slowly (BUT ROTATION NEVER STOPS)</p>
  
  <p><img src="https://i.stack.imgur.com/PXM3R.png" alt="enter image description here"></p>
  
  <p>2) When my y = (Screen Height) sprite rotates VERY FAST (and it also never stops)
  <img src="https://i.stack.imgur.com/gcbd1.png" alt="enter image description here">
  Here's my code: My update method</p>
  
  <pre><code>public void update(float dt){
      time += dt;
      float yInput = (Gdx.graphics.getHeight() - Gdx.input.getY());
      vec.set(Gdx.input.getX() - position.x, yInput - position.y).nor();
      //position is a Vector2 update sprite coordinates 
      position.x += vec.x * 15f;
      position.y += vec.y * 15f;
  }
  </code></pre>
  
  <p>and here's my draw method</p>
  
  <pre><code>public void draw(){
      batch.begin();
      sprite.setPosition(position.x - sprite.getWidth()/2, position.y - sprite.getHeight()/2);
  
      float xInput = Gdx.input.getX();
      float yInput = (Gdx.graphics.getHeight() - Gdx.input.getY());
  
      float angle = MathUtils.radiansToDegrees * MathUtils.atan2(yInput - position.y, xInput - position.x);
  
      if(angle &lt; 0){
          angle += 360;
      }
      sprite.rotate(angle);
  
      sprite.draw(batch);
      batch.end();
  }
  </code></pre>