title: Rotate sprite to face a point (cocos2d)
body: <p>I seem to be having an issue with calculating the angle between my sprite and a touch point. I'm trying to get my sprite to directly face the direction of the touch point whenever the user touches the screen. Here's my code:</p>
  
  <pre><code>-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
  
      CGPoint tapPosition;
      for (UITouch *touch in touches){
          CGPoint location = [touch locationInView:[touch view]];
          tapPosition = [self convertToNodeSpace:[[CCDirector sharedDirector] convertToGL:location]];
      }
  
      float angle = CC_RADIANS_TO_DEGREES(ccpAngle(fish.position, tapPosition));
      [fish runAction:[CCRotateTo actionWithDuration:0.5 angle:angle]];
  }
  </code></pre>
  
  <p>Any ideas? Thanks</p>