How to solve my simple geometric task? [closed]
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this questionIt seems I completely forgot geometry :-( It looks like a simple. I need it for my flash game.
I drawn it in Carmetal pr开发者_Go百科ogram:
I need coordinates of C(x,y). Please help me to find a solution.
You can stick with simple trig...
Here, the blue line length is (By - Ay). So the angle at B is acos((By - Ay) / AB)
. Subtracting that angle from the angle ABC, you find the angle at B in the larger triangle. Knowing the length BC and that angle, you can calculate the length of the brown line with
l1 = BC/sin(small_angle)
Similarly, the length of the blue and red lines together is
l2 = BC/cos(small_angle)
And C is (Bx + l1, By - l2).
精彩评论