Find the point with radius and angle

后端 未结 3 664
不知归路
不知归路 2020-12-03 21:50

I\'m not a genius in geometry, I\'d like to find a point in as3 with the radius and a angle but I don\'t remember the rule, I know thi

相关标签:
3条回答
  • 2020-12-03 22:35

    Let x0, y0 be the center of the circle being considered and t be the angle theta anti-clockwise from the x-axis (right horizontal).

    The point you are looking for is then

    x = x0 + r*cos(t)
    y = y0 + r*sin(t)
    
    0 讨论(0)
  • 2020-12-03 22:51

    You have to adjust your calculator to degree mode before making that calculation more likley you will use angle in degree

    0 讨论(0)
  • 2020-12-03 22:55
    as3.x = centerX + radius * cos(angle)
    as3.y = centerY + radius * sin(angle)
    

    Note that the rotation in the picture linked to is in the "negative direction". I.e, an increase of the angle, yields a counter-clockwise rotation.

    0 讨论(0)
提交回复
热议问题