Reputation: 1268
I have a circle that has a button on its tangent. I want to move that button around of circle, it will still stay on its tangent just the angle will change. I can move it by changing angle, but how to move it based on touches onto screen?
Upvotes: 1
Views: 78
Reputation: 80187
You can find touch point angle relative to circle center and use it:
Angle = Math.atan2(touchpoint.y - circle.center.y, touchpoint.x - circle.center.x)
Upvotes: 1