This implements a basic 2D inverse kinematics algorithm. Code is optimised for clarity, not performance, although it's fairly fast already, Parts may need to be rewritten for Butterfly integration.
Based on the circle-circle intersection code by Paul Bourke: http://paulbourke.net/geometry/circlesphere/ Minor bugfix 2017.09.25