Kyvadlo

Skopírujte a vložte kód do After Effects

freq = 3;
decay = 5;

t = time - inPoint;
startVal = [0,0];
endVal = [200,200];
dur = 0.1;
if (t < dur){
 linear(t,0,dur,startVal,endVal);
}else{
 amp = (endVal - startVal)/dur;
 w = freq*Math.PI*2;
 endVal + amp*(Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w);
}