How can I get a new position using a turning angle, the previous point, and an amount of distance/delta time?

683 Views Asked by At

I'm trying to simulate kinematics and I have a previous point (x,y), an amount of distance the point will have traveled in this time step, the current heading of the point, and an angle this heading will turn in this time step. Given this, how can I calculate a point that satisfies these requirements?

Thanks!

1

There are 1 best solutions below

2
On

Say that the current position is $(x,y)$, current heading is $\theta$, and you turn an angle $\alpha$ from this heading, and move a distance $r$. Let's assume that you measure the angles with respect to the $x$ axis. So that means that you would move in the direction $\theta+\alpha$. Note that both angles have a sign attached to them. Then the extra distance in the $x$ direction is $r\cos(\theta+\alpha)$ and the extra distance in the $y$ direction is $r\sin(\theta+\alpha)$.

$$x_1=x_0 +r\cos(\theta+\alpha)\\y_1=y_0 +r\sin(\theta+\alpha)$$