The flash version assume pendulum1._rotation = ball1*(Math.exp(-damping*to))*angle*Math.sin(fac*to);
That is why it is simpler.