# Translation over a vector trajectory

I'm working on a particle field system, where the particles can go from a point of the map, to another point of the map, using an angle (with sin and cos).

By now, I can calculate the vector by defining an angle using the cos and sin

float X = sin(DEGREES_TO_RADIANS(45));


That forms a trajectory, like in this image: (Trajectory in red) I need the particle to follow that trajectory, to move over that trajectory and arrive to the the vector (X,Y).

How can I translate the object ONLY over the red trajectory?

• Normalize x and y by the distance travelled in one frame, and move object to location O + (tx_n, ty_n) on frame t since movement started until it reaches the target. Sep 12, 2013 at 4:09
• Two ways: if you can sample the trajectory, key frame it using the sample points as intermediary positions OR use an integration method (Velocity Verlet since it conserves energy, is reversible in time, and accurate so you can Exactly stay on quadratic curves using any time step). But that's an overkill.. you essentially end up summing vectors.. what's the real problem you're facing? The question doesn't explain the problem.. just a vague goal. Sep 12, 2013 at 7:09
• I think the Peter comment can solve this 'problem'. I'll try later and I'll comment if it worked or not :) I think it will (Teodron) The 'problem' is the following: Imagine a particle over the (0,0) coordinate, There is a vector that starts from that point (origin) and arrives (X,Y), that makes a trajectory like in the image above, I need a particle animation that travels along that trajectory until it arrives to (X,Y), I haven't found any answer in google yet, maybe because I am a bad googler. Sep 12, 2013 at 11:59
• @user250783 if you move the object from the origin right into point (X,Y), then you will not see it go through any intermediary points on the red line. I.e. your frame step is always of magnitude 1.. are you sure this is what you need? Sep 12, 2013 at 13:30