title: Detect the degrees in a circle with users touch
body: <p>Im looking to create a swift function to return the degrees (Float) of the users touch on an image (SKSpritenode). In touchesBegan, I know how to detect the x &amp; y positions of my image. The idea is to create a function that takes in these positions and returns the degrees. </p>
  
  <p>Amended - The following code now works:</p>
  
  <pre><code>    class GameScene: SKScene {
  override func didMoveToView(view: SKView) {
      /* Setup your scene here */
  
     self.anchorPoint = CGPointMake(0.5, 0.5)
     myNode.position = CGPointMake(0, -myNode.frame.height / 2)
     self.addChild(myNode)
  
  }
  
  
  override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
     /* Called when a touch begins */
  
      for touch in touches {
          let location = touch.locationInNode(self)
  
  
              if myNode.containsPoint(location) {
              print("tapped!")
              let origin = myNode.position
              let touch = touch.locationInNode(myNode.parent!)
              let diffX = touch.x - origin.x
              let diffY = touch.y - origin.y
              let radians = atan2(diffY, diffX)
              let degrees = radians * CGFloat(180 / M_PI)
  
              print("degrees = \(degrees)") 
  
          }
  
      }
  }
  </code></pre>