M HYPE SPLASH
// updates

Calculating the instantaneous position of an object constant speed and varying direction

By Emma Payne
$\begingroup$

Given an initial position for an object that's moving at constant speed but with a direction that varies in a linear fashion over time, how can I calculate the instantaneous position of the object?

For example, if an object is moving a 2 km/h, with an initial position of (0,0), an initial direction of 0° and a final direction of 90° over a period of 1 hour, how can I get it's position at any point during that hour?

Please bear in mind that I'm a programmer, not a mathematician! With that in mind, I have no idea what to tag this question with....

$\endgroup$ 6

2 Answers

$\begingroup$

Assuming you mean that the angle goes from start angle to final angle at a constant rate, the object traces out a circular arc.

You can prove this by writing out the differential equations and solving them. I won't give a proof, however, because it doesn't seem like you are necessarily looking for one. Instead, I'll just give some general details about the arc traced by the object.

Suppose $\theta_0$ is the initial angle, $\theta_1$ is the final angle, $T$ is the total time between the two angles, and $V$ is the constant velocity. Then:

  • The angle at any given time $t$ is $\theta(t) = \theta_0 + \frac{t}{T} (\theta_1 - \theta_0)$.

  • Assuming the angles are in radians, the radius of the circle traced out is $R = \frac{VT}{\theta_1 - \theta_0}$. This follows from that the distance traveled is $R(\theta_1 - \theta_0)$, so the velocity must be $V = \frac{R\theta_1 - \theta_0}{T}$; then just solve for $R$.

  • If the object starts at $(0,0)$, the center of the circle is at $(R\cos(\theta_0 + 90^\circ), R\sin(\theta_0 + 90^\circ))$. (Adding $90^\circ$ to the angle $\theta_0$ gives us the direction from the object to the circle's center.) This simplifies to $(-R\sin \theta_0, R \cos \theta_0)$.

  • The displacement from the center of the circle to the object at any time is $(-R \cos(\theta + 90^\circ), - R \sin(\theta +90^\circ))$, where as above $\theta$ depends on $t$. This simplifies to $(R \sin \theta, - R \cos \theta)$.

To get the position of the object (in $(x,y)$ coordinates) at a general time $t$ just add the center of the circle and the displacement together: $$ \Big(x(t), y(t)\Big) = ( R\sin \theta - R\sin \theta_0, -R\cos \theta + R\cos \theta_0 ) $$ You can of course factor out the $R$ if you want.

Clarification

Regarding the limit as $\theta_1 - \theta_0 \to 0$, consider the $x$-coordinate: $$ R (\sin \theta - \sin \theta_0) = VT \frac{\sin \theta - \sin \theta_0}{\theta_1 - \theta_0} = VT \frac{\sin \left((\theta_0 + \frac{t}{T} (\theta_1 - \theta_0)\right) - \sin \theta_0}{\theta_1 - \theta_0} $$

Write $\theta_1 - \theta_0 = \Delta$. The limit as $\Delta$ goes to zero may be found by recognizing the definition of the derivative: $$ x(t) = \lim_{\Delta \to 0} VT \frac{\sin \left((\theta_0 + \frac{t}{T} \Delta\right) - \sin \theta_0}{\Delta} = VT \left( \frac{t}{T} \cos(\theta_0) \right) = Vt\cos\theta_0 $$

Similarly one may compute $y(t) = Vt\sin\theta_0$. Hence the object is just traveling in a straight line in direction $\theta_0$ with velocity $V$ (as expected).

$\endgroup$ 12 $\begingroup$

We are looking for $d(t)=(d_x(t),d_y(t))$, and we will need an expression for $v(t)=(v_x(t),v_y(t))$ to find it. If we consider the direction of the velocity with respect to the x-axis (call the angle $\theta$) we find that $\tan(\theta)=\frac{v_y}{v_x}$, or $$v_y =v_x\tan (\theta)$$ We are given that the direction of the velocity changes linearly so $$\frac{d\theta}{d t}=c$$ for some constant $c$, giving as a solution $\theta = ct + \theta_0$. Here $\theta_0$ is the direction of the initial velocity. Now if we use this expression in our expression for $v_y$ we find: $$v_y = v_x \tan(ct+\theta_0)$$ We also know that the magnitude of the velocity is equal to $V$ at all times. This magnitude is given by: $$\sqrt{v_x^2+v_y^2} = \sqrt{ v_x^2(1+\tan^2(ct+\theta_0)) }=\frac{v_x}{\cos(ct)+\theta_0}=V$$ Here we use $\sqrt{ (1+\tan^2(ct+\theta_0)} =\frac{1}{\cos(ct+\theta_0)}$ which is easily deduced from $sin^2+cos^2=1$.

Now we have: $$v_x=\cos(ct+\theta_0)V$$ and thus $$v_y = v_x \tan(ct+\theta_0)=\sin(ct+\theta_0)V$$ We can find $c$ from $\theta = ct+\theta_0$. For this we will need the direction of the velocity, $\theta_1$ at some $t_1$. these must be specified before hand or we cannot solve for $c$. Then we have, after rearranging, $c=\frac{\theta_1-\theta_0}{t_1}$. With $V$ assumed constant we now have $v(t)=(v_x(t),v_y(t))$: $$v(t)= \left(V\cos \left(\frac{\theta_1-\theta_0}{t_1}\cdot t +\theta_0 \right) , V\sin \left(\frac{\theta_1-\theta_0}{t_1}\cdot t + \theta_0\right)\right)$$ to find the displacement we integrate the velocity from the initial time to some time $t$: $$d(t) - d(0) = \int\limits_{0}^{t} \left(V\cos \left(\frac{\theta_1-\theta_0}{t_1}\cdot s + \theta_0 \right) , V\sin \left(\frac{\theta_1-\theta_0}{t_1}\cdot s + \theta_0\right)\right)ds = V \left[\frac{t_1}{\theta_1-\theta_0}\sin \left(\frac{\theta_1-\theta_0}{t_1}\cdot t + \theta_0\right) , -\frac{t_1}{\theta_1-\theta_0}\cos \left(\frac{\theta_1-\theta_0}{t_1}\cdot t + \theta_0\right)\right]_{t=0}^{t=t}$$ Here we used the fact that $d(0)=(0,0)$. Finally, this equals: $$d(t) = \frac{V t_1}{\theta_1-\theta_0} \left( \sin\left( \frac{\theta_1-\theta_0}{t_1}\cdot t + \theta_0 \right) - \sin(\theta_0), -\cos\left( \frac{\theta_1-\theta_0}{t_1}\cdot t + \theta_0 \right) +\cos(\theta_0) \right)$$

Just as a side note, in your example $\theta_0 = 0$, $\theta_1=\frac{\pi}{2}$, $t_1=1$ and $V=2$. When you use these in the final equation for the displacement you will find a much easier expression.

$\endgroup$ 6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy