M
M
Maxim Shimko2018-10-08 21:45:42
Mathematics
Maxim Shimko, 2018-10-08 21:45:42

How to calculate the flight of a projectile in two-dimensional space at an angle?

Hello. It is required to calculate the trajectory of the projectile. View of the map from above, at an inclination of 45 degrees (as in many strategies). You need something like this:
5bbba5d245a57186550403.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2018-10-08
@Prolfiic

Two subtasks:

  1. flight path
    We decomposed the initial firing vector into vert. and mountains. components and get the position of the projectile at any time in the form of coordinates (x, y, z).
    Now you need to project any point in this world of yours onto a screen that is at 45° to the horizontal. We do not consider that objects become smaller with distance, that parallel lines converge at one point, etc. Just throw any point on the screen so that it falls at right angles to the plane of the screen.
    We will assume that the center of the screen has coordinates (0, 0)and looks exactly at the (0, 0, 0)three-dimensional world. The screen has an axis to the Xright, an axis Yup. In the world, the axis is to the xleft, the axis is yup, the axis is zfar away.
    Shifting in the world in xthe same way will add X' to the screen.
    Offset in 3D y will add Ya little less screen space due to the 45° angle. Those. y multiply by the root-of-2 in half.
    The same with offset by z.
    X = x;
    Y = (y + z) * 0.7071;

    I suggest you independently combine these two revelations into a working code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question