...Well, it's not that kind of spring physics you’re probably thinking of, but I have no idea what else to call it.

Basically, I'm trying to replicate the effect of bending a flexible line (kind of like bending a fishing rod), but I'm having trouble with how to code it. Now, moving the line up and down with a set length should be fine (it'd just follow the physics behind a 'spring-board' effect), but I can’t wrap my head around the math needed when the 'radius' changes meaning the line should bend (because I want it to retain a set length - so it would have to bend to compensate for the change in distance from the origin).

I'm having a hard time explaining what I need help with let alone solving this myself, so I've made a quick diagram to illustrate the desired effect:


I realise this isn't a very simple task. I'd be REALLY grateful if anyone could share a link containing pseudo-code or the math needed for this kind of thing - I'm happy to learn it myself, I just don't know where to start.

Viza.