Two Arms moved by Motors to create straightline movement

Hi There,
I'm wondering if anyone has found a good library to determine motor angles to move two connected arms, eg when motor A controls the direction of Arm A, and Motor B is at the end of Arm A and controls the direction of Arm B, and there's a {hand} at the end:

Motor(A)[-----------armA------------------[Motor(B)]------------armB---------------]{hand}

say I start with motor A at -45degrees, and motor B at +45 degrees ... and I want to move the hand upwards, straight upwards ... without any extension in the arc (fromM(A) to {hand}) ... The Arms are the hypotenuses, and the angles of the motors can use standard trigonometry and geometry, but the logic of whether to move MotorA slower or faster, and MotorB slower or faster ... quickly becomes quite complicated.

Has anyone used a library to make this easier?

Why not use old fashioned trigonometry and create the formulas?
It's unlikely to find a library doing something like that. It's odd.

I'm about to write one ... just seems like a standard problem

It sounds like you're describing inverse kinematics. In that case, it's far from a trivial problem, but there are solutions out there. Google is your friend.

Arduino's Braccio arm uses a library with angles, but its parts were measured so it "knows" what to do to get to a position. How would a generic library know the number, length, position, orientation and angles of your segments and motors?

  1. Mockup your arm in cardboard.
  2. Record movement data.
  3. Profit.