The question I asked probably isn’t very clear, so I’ll explain. If I have an x and y velocity, where the y goes towards the bottom of the screen, and the x goes towards the right of the screen, how would I convert the x and y velocity so that the y goes from the point to the particle at hand, and the x goes at a 90 degree angle from the y? If that explanation wasn’t clear, then the reason I need to do this is so that I can minus a velocity as a particle tries to go away from a gravity source, but that source isn’t just at the bottom of the screen.
What I have:
What I want:
Examples would be appreciated
3
This is simpler than you think. Suppose you have a particle at position P with velocity V, and there is a gravitational attractor at G. The acceleration will act in the direction (G – P), call it A. Of course P, G, V, and A are all two-dimensional quantities.
You have to update position and velocity with each increment of time dt. You already know the new position is P + V dt. The new velocity will be V + A dt. There is no need to transform any vectors. You just have to calculate A = k(G – P).
2