Getting the precise angel of a mouseposition in relation to a center point??
in
Programming Questions
•
1 year ago
Hi,
I would like to check if a mouse position is inside the space of an arc shape. To do this I first check if the point is within the radius of the arc. Then I would like to test if the mouse position is within the end- and start degree of the arc.
I used following code and good old trigonometry to get the sinus of the given mouse position:
if (pointLength<= 100)
{
degree = degrees(asin((yenterArcY-mouseY)/pointLength))
}
My problem of course is that i cannot convert sin to radians and I get no precise radians or degree value! :-( Do you know a solution? Hope this is a piece of cake for somebody of you ! :-)
Regards,
Tim
I would like to check if a mouse position is inside the space of an arc shape. To do this I first check if the point is within the radius of the arc. Then I would like to test if the mouse position is within the end- and start degree of the arc.
I used following code and good old trigonometry to get the sinus of the given mouse position:
if (pointLength<= 100)
{
degree = degrees(asin((yenterArcY-mouseY)/pointLength))
}
My problem of course is that i cannot convert sin to radians and I get no precise radians or degree value! :-( Do you know a solution? Hope this is a piece of cake for somebody of you ! :-)
Regards,
Tim
1