Spring into action

G,day. Im trying to animate a Luxo Jr Style lamp, and want to control the sqaush and stretch of the springs as the lamp moves. Ive tried a combination of expression/aim constraint. The expression relates the scaleY of the spring to the rotateZ of the Joint, and the aim constraint keeps the spring pointing toward its fixed point on the lamp arm. this solution is successful within limits but as the angles become larger the spring is 'overstretching' and is obviously not correct. Does anyone have any alternative setups/solutions. v.grateful for any pointers.

"I'd prefer to achieve immortality by not not dying"

i suggest you use a the distance measure between two points as the guide for length.