2D Inverse Kinematics


Demo coming soon...


Q: What is inverse kinematics?

Inverse Kinematics is having a series of connected links that constitute a limb, where the links are
rotated in order for the limb to reach a specified position with its tip. The (base) position of the
first link is fixed, giving the limb a fixed base position.

Armed with a definition of Inverse Kinematics. I define my link data as follows:
As you can imagine there are different possible scenarios:

Defining a goal (and the problems that must be overcome to achieve it):


Let's make a limb that operates on 2D IK to try and reach a target position which we can move around.
This limb will be structured roughly like a mantis's mandible, with the following rules:


Let the following serve as motivation:

As you can see, the result of achieving the goal will awesome.

Solving the problem(s):

There are a number of popular approaches to achieving IK: I will not be using any of these for the following reasons.
What I will do to simulate 2D IK is use an iterative approach, determining minuscule amounts
that each link should rotate then applying those amounts to each link's rotation (angle):

Given this approach, here are two important formulas that will be of use: