I do not know what I did wrong in this code:
func findDegree() -> Double {
let xValue = directionstick.center.x - 35
let yValue = directionstick.center.y + 20
let newX = xValue*xValue
let newY = yValue*yValue
let hypo = (newX+newY).squareRoot()
return (xValue/hypo)
}
This code is for finding the amount of rotation.