- #1
kiriri
- 6
- 0
Hello,
I'm not sure if this is the right section because this is somewhat of a hybrid of math and physics.
Say I have a ball in 3D space, its initial position and its' initial acceleration. Furthermore I have another point in 3D space which I want the ball to pass through, if possible. The gravity is 9.81 m/s2. Friction etc is of no importance.
How could I calculate the initial angle or tangent of this curve, so that the ball would hit the point , if possible?
In case that just now wasn't all that clear, I'll explain my problem in my current context. I'm a game developer and want players to be able to click at a point and jump to it the next time they hit space. However, they can charge their jump and if they are very close to the target and have charged up the jump a lot they must jump in a high arc to hit the target sqarely. If the target is too far away, the player should jump using 45%, but I can program by comparing the distance. All I need is a formula which takes the initial acceleration and the gravity and calculates which angle is needed to hit that point
I'm sorry to bother you guys with such a simple question, but I really wasn't able to find a solution on my own.
best,
kiriri
I'm not sure if this is the right section because this is somewhat of a hybrid of math and physics.
Say I have a ball in 3D space, its initial position and its' initial acceleration. Furthermore I have another point in 3D space which I want the ball to pass through, if possible. The gravity is 9.81 m/s2. Friction etc is of no importance.
How could I calculate the initial angle or tangent of this curve, so that the ball would hit the point , if possible?
In case that just now wasn't all that clear, I'll explain my problem in my current context. I'm a game developer and want players to be able to click at a point and jump to it the next time they hit space. However, they can charge their jump and if they are very close to the target and have charged up the jump a lot they must jump in a high arc to hit the target sqarely. If the target is too far away, the player should jump using 45%, but I can program by comparing the distance. All I need is a formula which takes the initial acceleration and the gravity and calculates which angle is needed to hit that point
I'm sorry to bother you guys with such a simple question, but I really wasn't able to find a solution on my own.
best,
kiriri
Last edited: