The maths bit

Taking the equation for simple harmonic motion: x=ω2x We can introduce the derivative operator: D=ddt This gives us: x=d2xdt2=ddt(ddt(x))=D(D(x))=D2x D2x=ω2x This looks like a matrix, so let's see what happens in 2D: D=(abcd) D2=(a2+bcb(a+d)c(a+d)d2+bc)=(ω200ω2) Solving b(a+d)=0 gives us either b=0 or d=a. If we assume that b=0 then this implies a2+bc=a2=ω2 which cannot be solved in the reals, so it must be that d=a: D=(abca) We still have a2+bc=ω2. This only has 2 degrees of freedom (you can only pick 2 of a,b,c and the third will be fixed) so lets try rewriting it: a2+bc=ω2bc=(ω2+a2) Let a2=ω2(p21),|p|1,sgn(a)=sgn(p): bc=(ω2+a2)=p2ω2 b=pqω,c=pω/q,q0 Dp,q=ω(sgn(p)p21pqp/qsgn(p)p21) We can see that p=q=1 gives us the rotation matrix that we expect to see in the perfectly circular case since we then have that the velocity is 90 degress out of phase with the position, which is itself 90 degress out of phase with the acceleration: D1,1=(0ωω0) This can be simplified using the identity sec2(ϕ)=tan2(ϕ)+1: p=ksec(ϕ),k=sgn(p) Dp,q=ω(ktan(ϕ)qsec(ϕ)sec(ϕ)/qktan(ϕ)) And here we have the general solution for the instantaneous velocity and acceleration of a point undergoing simple harmonic motion in 2D. Note that k can be folded into tan(ϕ) since tan(ϕ)=tan(ϕ) but sec(ϕ)=sec(ϕ).

The demo bit

Since we have a closed form solution for the general case, here's an interactive demo. k,ϕ,q,ω are as above, and θ,r define the offset of the orbiting body (the black line). T defines how many seconds to simulate into the future (the blue line). The red and green lines show the instantaneous velocity and acceleration respectively. You can click to place the point at an arbitrary position.

Configuration:

ϕ= 0

q= 1

ω= 1

Position:

θ= 0

r= 1

Simulation steps:

T= 2

Sorry, your browser does not support canvas.