# calculating x y coordinates of a moving object

I'm am trying to figure out how to calculate an expected x y position given starting x y, velocity and angle. If velocity is a maximum of 4 pixels per turn how can i estimate where finishing position is in say 5 turns time?? I'd really appreciate a formula for this as I've been trying to implement it in code but I'm clearly not very good with math. Much thanks in advance kind people

• You are allowed a maximum of four pixels per "turn", does this mean you could always use the maximum, or that you have to consider what the minimum might do as well? Feb 28, 2015 at 4:04
• sorry yes the minimum is 1 Feb 28, 2015 at 4:17

Break it into coordinate directions. Given an angle of $\theta$ where an angle of zero corresponds to the positive $x$ direction, and an angle of $90^\circ$ (or equivalently $\pi/2$ radians) corresponds to the positive $y$ direction, an initial $x$ coordinate (labeled here as $x_i$), an initial $y$ coordinate (labeled here as $y_i$), and an initial velocity (labeled here as $v$) you have the parametric equations:
$$x(t) = x_i + vt\cos(\theta)\\y(t)=y_i+vt\sin(\theta)$$
It should be mentioned, here I use $v\cos(\theta)$, but you could just as easily define $v_x = v\cos(\theta)$ where $v_x$ is the "velocity in the $x$ direction." This simplifies equations in the case that you don't want or need to find or define the exact angle.