It's me again with my ball problematic, after 3 closed questions that really helped me out I figured out I would make a short video, so you'll have a better understanding of the problem. I have this formula:
\begin{eqnarray} x(t) &=& A e^{-\gamma t/2} \cos(\omega t - \phi) \\ y(t) &=& B e^{-\gamma t/2} \cos(\omega t - \psi)\\ \end{eqnarray}
this formula is for an unforced 2d damped harmonic oscillator and honestly I've tested it and is looks like it's the good one. Now my problem is for $\phi$ and $\psi$. When I set them to $0$ I get an oscillation on a straight line but as you can see in the video I suspect that based on the mouse movement appears a phase shift on either one or two of the axis making the ball rotate around the equilibrium. At this point I'm unable to understand this motion and reproduce it neither knowing which forces are implied.
the description of the motion is the following:
- When I click on the screen the ball gets attracted tho the clicked point
- When I hold the mouse pressed the ball oscillates around the clicked point (equilibrium)
- When I release the mouse, the ball continues it's way based on the direction and velocity of the oscillation
- When reaching the end of the object the ball collides and I guess I only need to change the sign of $dt$ (where $dt$ is the difference between current frame position and previous one)
- When moving the mouse I guess operates some sort of centripetal force which I'm unable to emulate at this point.
Here is the link to the video
my question is how can I find both phase angles to emulate this motion.