3d parabola (projectile motion) to hit a target on an arbitrary plane

Click For Summary
SUMMARY

This discussion focuses on calculating the trajectory of a projectile in 3D space to hit a specific target on an arbitrary plane. The user has successfully implemented a parabolic motion model using initial launch parameters, including launch point, target point, initial velocity, and gravity. However, they are struggling to adjust the trajectory to account for rotations around different axes while ensuring that the projectile still hits the target. Key mathematical concepts discussed include the use of rotation matrices and the calculation of angles for trajectory adjustments.

PREREQUISITES
  • Understanding of 3D coordinate systems and projectile motion
  • Familiarity with rotation matrices and their application in 3D space
  • Knowledge of parabolic equations and their parameters
  • Basic physics concepts such as gravity and velocity vectors
NEXT STEPS
  • Research the application of rotation matrices in 3D transformations
  • Study the derivation and application of parabolic motion equations in 3D
  • Explore the effects of external forces (e.g., wind) on projectile trajectories
  • Learn about quaternion mathematics for 3D rotations and their advantages over matrices
USEFUL FOR

Software engineers, game developers, and physicists working on simulations involving projectile motion in 3D environments.

  • #31
Ok, I'm just going through your explicit calculation but I noticed I misunderstood you at the start concering the coordinates.
My projectile goes from (0,0,0) to (xt,0,zt)
Yours goes from (x1,y1,z1) to (x2,y2,z2) and after your redefinition (0, 0,0) to (xp, yt,0).
 
Physics news on Phys.org
  • #32
betel said:
Ok, I'm just going through your explicit calculation but I noticed I misunderstood you at the start concering the coordinates.
My projectile goes from (0,0,0) to (xt,0,zt)
Yours goes from (x1,y1,z1) to (x2,y2,z2) and after your redefinition (0, 0,0) to (xp, yt,0).

well actually i think is more something like

(x1,y1) to (xp, yp) where yp = yt anyway, is xp that changes as a "proportion" of x2 and z2

to have everything in a way that works in 3D
 
  • #33
My idea was wrong. Easy to check in the even leveled case.

Yours seems to be correct though. Just solve the quadratic for v^2 and then do the square root again and you get.

v= \sqrt{g(y_p-y_0+\sqrt{(y_0-y_p)^2+x_p^2})}

You would have really made your life much more easy if you had chosen (0,0,0) as the start and zt=0. It is much faster to later transform the coordinate system.
 
Last edited:
  • #34
Arioch82 said:
Hi Petr and thank you for your reply.

unfortunately I've already tried that one and it doesn't give me the desired result.

If you see the new screenshot attached to this post you can notice that in that way (well I'm using quaternions instead of a matrix but it should be the same) the all parabola rotates around the axis while a need the start (point with the axis displayed) and the goal (green sphere at the end of the cyan line) to be fixed so that i can launch my projectile from my start point to hit a specific target as like an "effect/curl" is applied to the parabola.

in the screenshot I'm applying a rotation around the cyan axis, I've also tried around the magenta one (direction on the XZ plane) with similar result.
The first red segment from the start point to the start of the parabola is displayed only because I'm assuming that the start point is always the first point (t=0)

Ok, so you want to rotate the parabola taking initial and final points fixed. This should be the solution:

1) the direction of the rotation must be the one connecting the initial and final points:

\mathbf{n}=\frac{\mathbf{x}_f-\mathbf{x}_i}{|\mathbf{x}_f-\mathbf{x}_i|}

2) use this n and the angle you want, to construct the rotation R, like I said in my previous post, or with quaternions if you like.

3) Don't just do a linear rotation

\mathbf{x}'=R\mathbf{x}

but do instead an affine rotation

\mathbf{x}'=\mathbf{x}_i+R(\mathbf{x}-\mathbf{x}_i)

EDIT: oops I saw too late that the thread went on for 3 pages, and that the solution was already there...
 
  • #35
betel said:
My idea was wrong. Easy to check in the even leveled case.

Yours seems to be correct though. Just solve the quadratic for v^2 and then do the square root again and you get.

v= \sqrt{g(y_p-y_0+\sqrt{(y_0-y_p)^2+x_p^2})}

You would have really made your life much more easy if you had chosen (0,0,0) as the start and zt=0. It is much faster to later transform the coordinate system.

Thank you betel, that works perfectly, I know that with (0,0,0) my life would be much easier but know I've got a general system to target a point from everywhere.

Thanks to Petr too!

I've also found out that my quaternion wasn't working because I wasn't applying an affine rotation but a linear one.
Using the affine it works great with quaternions too (as it should obviously be) :)

Thank you guys for your help, really, everything works just fine now!
 
Last edited:

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K