# 2D Vectors trajectory parametrization

This topic is 2942 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

I want to move a 2d sprite in the screen.

I have 2 vectors: initial position (A) and end position (B).

I want to move the sprite from A to B in a straight line in T seconds.

¿How do I parametrize the trajectory? I mean, I supose I'll need to keep a "real position" vector value, how do I calculate it in each instant of T?

Thanks

##### Share on other sites
Your problem is a bit ambiguous since you've not told us 'how' you want it to move in a straight line (aka should it move with a constant speed etc :P)

In the simplest case (constant speed) you simply have a velocity of (B-A)/T which remains constant

##### Share on other sites
$\vec{S}: [ 0, \Delta t] \to \mathbb{R}^{2},\;\; t \mapsto \vec{A} + \frac{t}{\Delta t}\left ( \vec{B} - \vec{A} \right )$

##### Share on other sites
Quote:
 Original post by luca-deltodescoYour problem is a bit ambiguous since you've not told us 'how' you want it to move in a straight line (aka should it move with a constant speed etc :P)In the simplest case (constant speed) you simply have a velocity of (B-A)/T which remains constant

thanks. I think its just what I need

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633282
• Total Posts
3011206
• ### Who's Online (See full list)

There are no registered users currently online

×