Wondering if anyone has some ideas for me. This is also for 2D. Given a circle C(pos,r) I would like to drop a particle of arbitrary mass in, and watch it spiral towards the center.
However, it's position based. What I need is a directional force proportional to the distance from the center. So as the particle gets closer and closer to the center, the force increases.
I am not sure I understand what the problem is with it being "position based". Do you mean that you need to come up with a field of accelerations --not velocities-- that will produce spirals?
Any attractive force will cause the particle to fall in a spiral, ending in contact instead of an orbit at some distance if there is attrition. Attrition makes the particle lose energy, until it has no potential energy and it reaches the attractor.
With a constant force towards the spiral center plus a constant force opposite the current velocity vector you cannot go wrong.
I am not sure I understand what the problem is with it being "position based". Do you mean that you need to come up with a field of accelerations --not velocities-- that will produce spirals?
Hi Alvaro,
Yes, I am looking for F=ma => a=F/m. I know the mass, but I don't know how to calculate the Force vector which of course needs a normalized direction and a magnitude for a spiral.
Well, you could try with something like (-x/(x^2+y^2), -y/(x^2+y^2)), but you also need to add linear drag to your equations of movement, or you will just get periodic orbits.
It you are dropping particles with some angular momentum, they will spiral. If you want the field to add the angular momentum, you can add something proportional to (y, -x). I would try that, that divided by distance to the origin, and that divided by distance to the origin squared, all of them multiplied by various constants. But I don't know what effect you are looking for exactly, so you'll have to play around with it yourself.