Sorry for the confusing title, I'll do my best to describe the issue I'm having. This is for a game I'm making but I'm asking the question here because it's not a programming question - it is a math question. I have a game character that, when the left/right mouse button is clicked, their arm will reach for the mouse (image of player arm pointing at mouse). This is simple when the mouse is out of reach as the character just needs to make their arm a straight line. This is more difficult, however, when the mouse is in a position closer to the base of the arm than the upper and lower arm's combined length (image of player arm trying to point at a mouse position close to the player - the blue line is where the arm needs to go).
I think it's easier to understand what I need based on the sourced images. I essentially need to find the two angles from the base of the arm to the mouse position in order to create the correct bend in the player's arm.
P.S. Ignore the ridiculous legs. I haven't reworked the legs to be two parts yet so they're still really small...
I think this would be classed as a "homework problem", so instead of answering, I'll just give some tips.
Basically, your problem is to find the angles of a triangle, that goes from the shoulder, to its elbow, to it's hand, and back to the shoulder again.
I would recommend:
Does that help?