Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

If I have an image 720, 720 that looks like this..

enter image description here

How do I work out the angle of the touched x,y given that the center x and y are 360, 360 A lot of calculations I see for this assume the origin is 0,0 (which is top left) so I get incorrect results. I am assuming 0 is always to the top and not rotated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
411 views
Welcome To Ask or Share your Answers For Others

1 Answer

Here is the general formula:

angle = atan2(mouseY - cirleCenterY, mouseX - circleCenterX);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...