Problem of control of the vertices

You can do no better than to look at another programmer’s solution to a problem you are trying to solve. If you visit the following thread you will find a link to download Jim Hamilton’s rack and pinion ruby code.