-1
$\begingroup$

Given two points (x1, y1, z1), (x2, y2, z2). If I want to launch a projectile from point a to point b (with some angle) such that it follows a arc/parabolic-like trajectory, how would I formulate an equation to solve this? Or better yet, define a vector that represents the launch trajectory/direction and magnitude (velocity).

I understand that the first step is to represent this problem in 2D by simply calculating the horizontal distance between the two points and using that as my Δx but I am lost as to how, once solved in 2d, I can translate it back into 3D?

$\endgroup$
1
  • 1
    $\begingroup$ Note that there are an infinite number of parabolic trajectories connecting your two points (unless one is directly above the other). You can reduce that by providing an additional constraint, eg minimize the launch speed. $\endgroup$
    – PM 2Ring
    Commented Apr 1, 2020 at 1:00

1 Answer 1

1
$\begingroup$

First place a coordinate system to one point and express the coordinates of the 2nd point relative to the first. This way

$$\begin{aligned} \boldsymbol{r}_A & = \pmatrix{0\\0\\0} & \boldsymbol{r}_B & = \pmatrix{X_B\\Y_B\\Z_B} \end{aligned} $$

The difficulty here is finding the 3×3 rotation matrix $\mathbf{R}$ which transforms a 2D point $(x,y,0)$ into a 3D point $(X,Y,Z)$. But this rotation matrix is subject to certain constraints.

  • Gravity needs to remain vertical (along the negative y-axis)
  • The second point is somewhere in the local xy plane (have $z=0$)

This is achieved with a rotation about the Y axis of some angle $\theta$. This angle is $$ \tan \theta = \frac{Z_B}{X_B} $$ and the rotation matrix

$$ \mathbf{R} = \left| \matrix{ \tfrac{X_B}{\sqrt{X_B^2+Z_B^2}} & 0 & -\tfrac{Z_B}{\sqrt{X_B^2+Z_B^2}} \\ 0 & 1 & 0 \\ \tfrac{Z_B}{\sqrt{X_B^2+Z_B^2}} & 0 & \tfrac{X_B}{\sqrt{X_B^2+Z_B^2}}} \right| $$

and the inverse

$$ \mathbf{R}^\top = \left| \matrix{ \tfrac{X_B}{\sqrt{X_B^2+Z_B^2}} & 0 & \tfrac{Z_B}{\sqrt{X_B^2+Z_B^2}} \\ 0 & 1 & 0 \\ -\tfrac{Z_B}{\sqrt{X_B^2+Z_B^2}} & 0 & \tfrac{X_B}{\sqrt{X_B^2+Z_B^2}}} \right| $$

So now the 2D to 3D transformation is

$$ \pmatrix{X\\Y\\Z} = \mathbf{R} \pmatrix{x\\y\\0} $$

and the 3D to 2D problem

$$ \pmatrix{x\\y\\0} = \mathbf{R}^\top \pmatrix{X\\Y\\Z} $$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.