Inverse kinematics to allow an arm to grab the mouse pointer. Press "g" to see the geometric vertices used for the angle calculations. Written to help with forum post - https://scratch.mit.edu/discuss/topic/718995/ According to Wikipedia: "Inverse Kinematics is the mathematical process of calculating the variable joint parameters needed to place the end of a kinematic chain, such as a robot manipulator or animation character's skeleton, in a given position and orientation relative to the start of the chain."
I remixed this so that the hand would keep "reaching" for the mouse, even when it is out-of-reach; and also to animate the hand a bit. That part turned out very crudely. Someone with an ounce of artistic talent please redo it!