Alright so I have no idea how to explain this but pretty much I`m a game developer and I've come across a problem, I have to point the arms at the mouse, I know exactly what to code just not the math behind it, so this is my problem:
The arm has two joints (points) called Shoulder and Elbow, with each joint comes a part of your arm (So attached to shoulder is Half of your arm, your elbow, then the other half of your arm, but we also have the elbow which is attached to in the center). Pretty much this is a real arm, you have a shoulder and an elbow joint. The problem is I need to have the fist of the arm always in the same position on the screen, to do this I need to make the two joints always at a certain perfect angle so that they reach point B.
So to summarize (sorry if this is confusing):
Point A: Shoulder
Point B: The target point, this can vary so I need a formula
Joint: The connecting joint between Point A and Point B, it also connects the two halves of the arm
A few things to note: The arm size can never change, but Point B will always be in reach (I set point B manually somewhere else, don't worry about point B).
So here is what I need to figure out: How do I figure out the formula for Point A and Joint's angle so that the tip of the arm hanging off of Joint always touches point B? Like this:
Edit: I forgot to mention I can ALWAYS get the magnitude from Point A and point B