The Algorithm

The algorithm is slightly different depending on whether the rightmost reflex vertex is on the upper or lower chain of the polygon. I present the case where it is on the lower chain, the oher case is symmetrical.

Until the polygon is convex:

The Move

Move Diagram

Here j1 is the rightmost reflex vertex, and jp is the first joint not to the right of the ray ( j0, j1 ).

First we fix the position of all the joints jp+1 through jn-1 (which aren't shown here) as well as j0 and jp. Then we fix all the joint angles, except for the four joints we will be moving: j0, j1, jp-1 and jp.

This has for effect of fixing the distances || j0 jp || and || j1 jp-1 || (shown as dotted lines).

Now simply rotate j1 clockwise about j0, the motion of the other two moving joints is uniquely defined since all the link lengths are to be maintained.

Notice that we completely ignore the joints between j1 and jp-1 for the move. We can do this because because we have fixed all the angles on that chain, so it can just be considered an edge between j1 and jp-1 for the purpose of executing the move.