Here is a no-trig calculation, derived from straight-forward Grade 11 Trig and Physics. It assumes that the origin is the lowest point of the pendulum bob's suspension, that L is the length of the pendulum, and that the normal graphics convention of y increasing down, and x increasing to the right is adopted:
Update: I messed up yAcceleration initially; this is easier.
Update #2: Added explicit time control, and added units of measure.
const float gravity = 9.8; // units of metres/sec/sec
const float deltaT = 0.001; // equals 0.001 sec or 1 millisecond
var xVelocity = 0.010; // units metres/sec equals 10 cm/sec
var x = 0.0; // units metres
var y = 0.0; // units metres
while (true) {
var xAcceleration = -gravity * (x/L) * (L-y)/L;
x += (xVelocity + (xAcceleration/2 * deltaT)) * deltaT;
y = Math.SQRT(L*L - x*x) - L;
xVelocity += xAcceleration * deltaT;
}