help with rope/chain effect

Alright, so I'm trying to create a fairly basic rope with Box2D. Here's what I've got so far:
http://andydremeaux.com/test/ekg/

I'd like to shorten the link length but I've got no idea how. This is adapted from the "bridge" demo but the code in there was a bit of a mess, with lines like such:

bd.position.Set((100 + 22 + 44 * i) / m_physScale, two / m_physScale);
...
anchor.Set((100 + 44 * i) / m_physScale, two / m_physScale);

What are those constants? How do they work? I've tried setting matching ones as variables (all the 22s, all the 44s, etc) and messing around with the values but I'm not having too much luck. How can I set it up so that I can change the link length with a single variable?


My other question is, is it possible to set up such that if you pulled it past a certain point it would stretch to the cursor? Or would there be a good way to dynamically lengthen the line to fake the effect?

Oh, one more: any way to get it to come to rest sooner?


thanks
-andy

Original thread: https://box2d.org/forum/viewtopic.php?t=3980