This is actually a rather simple-minded specific solution to inverse kinematics, but since the dynamic programming solution is harder to implement in a functional language, I chose this straightforward approach.
This Demonstration was inspired by Professor Oussama Khatib's Introduction to Robotics Course, available free online through Stanford's Engineering Everywhere.