# Converting orientation and speed to position

I have a body located at $(x,y,z)$ at time $t_0$. I know the body is moving at a constant speed, $s$ (I don't know the direction he's moving only the magnitude of the velocity vector). The body's orientation is a known constant $= (h,p,r)$ (heading pitch and roll). I would like to calculate the location of the body after $t$ seconds as a function of $x,y,z,h,p,r$. How do I do this? Thank you.

-

There is not much linear algebra involved. All you need is trigonometry to find the forward direction $d$ of your body. It is clear that roll does not affect the direction, and you can then figure out (following appropriate conventions) that:
$d_x = cos(p) . cos(y)$ , $d_y = cos(p) . sin(-y)$ , $d_z = cos(p)$
Then, you get the position vector $p$ at time $t$ using $p=p_0+d.s.t$, where $p_0$ is the initial position.
In vector notation the position is given by $$\vec r=x\, \vec i+y\, \vec j+z\, \vec k$$ The velocity vector $$\dot {\vec r}=\dot x\, \vec i+\dot y\, \vec j+\dot z\, \vec k$$ You are given the magnitude such as $$v=\sqrt{\dot x^2+\dot y^2+\dot z^2}$$ Note that the orientation (direction) is the unit vector of velocity vector and can be described as $$\vec u=\frac{\dot {\vec r}}{||\dot {\vec r}||}=\frac{\dot x}{\sqrt{\dot x^2+\dot y^2+\dot z^2}} \vec i+\frac{\dot y}{\sqrt{\dot x^2+\dot y^2+\dot z^2}} \vec j+\frac{\dot z}{\sqrt{\dot x^2+\dot y^2+\dot z^2}} \vec k$$ Since $\vec u$ and $v$ is known to you you can find the constant velocity vector as $$\dot {\vec r}=v \times \vec u$$ and the position after t seconds $$\vec r(t)=\vec r(0)+v \times \vec u$$