help with the maths of a simple robotic arm

Take a look at this and see if it will help you.

http://www.circuitsathome.com/mcu/robotic-arm-inverse-kinematics-on-arduino