If you can select the mouse position (x, y) with a sufficiently high temporal resolution, you can calculate the accelerations X '' and Y '' numerically. Suppose you measured three X-positions at known times: (x0, t0), (x1, t1), (x2, t2).
Calculate v = X '= dx / dt for the intervals (t0, t1) and (t1, t2):
v0 = (x1 - x0) / (t1 - t0) at time tv0 = (t1 - t0) / 2
v1 = (x2 - x1) / (t2 - t1) at time tv1 = (t2 - t1) / 2
Then we calculate X '' = V '= dv / dt = (v1-v0) / (tv1 - tv0)
Y '' is calculated in the same way. Then you can connect X '' and Y '' to the equations you have already found to calculate the position of the pendulum in the next step.
source share