If you use angle cta as independent variable, and write equation for cta, omega
For example:
d(cta)/dt=omega;
d(omega)/dt= -g*Math.sin(cta)/L;

x=xc+L*Math.sin(cta);
y=yc-L*Math.cos(cta);

Then you will have a pendulum.
This is one of the example I taught (if you have check out my flash tutorial about EJS).