math - Simple Problem - Velocity and Collisions -


OK I'm working on a space SIM and the more SIM I need to work where the opponents will ship 3D position) When my bullet arrived at it, how do I calculate the velocity that the bullets travel and the speed of the ships of the opponents?

Calculate the relative velocity vector between him and yourself: if you were still standing then The movement can be considered. Calculate your relative distance vector Now you know that it is already D away and unit V is moving forward every time. You have 'V' to calculate, and you know that its length is but its direction is not.

Now you are creating a triangle with these two obstacles, its V and your bullet V '. It looks like two dimensions:

Dx + Vx * t = V'x * t

sub + ve * * t = V 'Y * t

V'x ^ 2 + V'y ^ 2 = C ^ 2

Which simplifies :

(Dx / T + VX) ^ 2 + (Vice President / T + VX) ^ 2 = C ^ 2

And you use quadratic formula You can use this technique to apply it in three dimensions similarly to solve it. There are other ways to solve this, but this vector is simply simple algebra instead of Calculus.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -