0

In this game I am trying to build an artillery piece that can hit points on the map.

I have access to

My location (X,Y,Z) - Target's location (X,Y,Z) - Target's distance

Assuming its at the same Y, the artillery can hit something 1000 "blocks" away when aimed at a 45 degree angle.

Let's say I'm at 0,0,0, and I want to hit an enemy at 500,0,500, what would I have to do to figure out the angle I need to aim at in order to hit the target?

If I am missing information or if my question makes no sense please let me know!

  • Assuming the only force acting is gravity (eg lack of air resistance) this can be solved without even using differential equations... Just involves integrating twice. If you want to include air resistance you'll need a dif eq, but it's still fairly easy to solve it explicitly. – Brevan Ellefsen Feb 23 '23 at 21:05
  • even trigonometry or splitting into vectors will work. See Projectile Motion – D S Feb 23 '23 at 21:30
  • Let's hope you are really building a video game and that you are not a trrorist. – P. Lawrence Feb 24 '23 at 07:27

0 Answers0