Advertisement

help: direction to hit a moving target?

Started by April 10, 2001 03:39 PM
18 comments, last by youngo 23 years, 9 months ago
quote:
Original post by Anonymous Poster

Original post by taliesin73

Um … the origin?





if i aim at the origin of the target at time 0 and the missle can''t hit it in 0 seconds it will miss.

i was looking for some kind of formula or algorithm..



Okay, the reason for the was for this reason: at t = 0, the target will be at its origin and so will the missile … with no other information, they could well both be at the same place.

However, assuming both are moving with a constant velocity, you would need to know how far apart they are to start with, and how fast each are moving to be able to figure this out.

I''m guessing that more general algorithms have been suggested in the other posts, I haven''t read them (looked too technical for the moment ) - I was thinking a specific solution was required.

I think what you need to do is is find when the trajectory is tangential to the arc of the rocket''s velocity - or something like that. For example, if the rocket travels at 900 units/sec, then at one second you have a 900 unit radius from the initial position, and you want to find out where your target is at 1 second, if there is a solution (there probably won''t be).

Anyway, this is making my brain hurt, I used to be good at this stuff but then I left school and didn''t need it any more




Get a stripper on your desktop!

quote:
Original post by youngo

or

100/s = velocity of a target (moves straight)
110/s = velocity of a missle (moves straight)

at what time could they collide?




Maybe never, if they are parallel. Be careful not to mix speed with velocity ... velocity needs a direction.

--


Get a stripper on your desktop!

Advertisement
quote:
Original post by LilBudyWizer

That said I tried solving the equations in both MathCAD and Mathematica. Perhaps I did something wrong, but MathCAD ran out of memory and Mathematica still hadn''t found a solution when I cancelled it 30 minutes later. Replacing vm*cos(theta) and vm*sin(theta) with vm.x and vm.y and adding the equation vm.x^2+vm.y^2=vm^2 got Mathematica to solve it relatively quickly, but I must say that was about the longest equation I''ve ever seen. It looks like somewhere between 50 and 100 pages printed. There must be a simplier solution, but right now I don''t have time to play with it.




would i need a third equation to solve this if the points are 3d?
if so what would it be?
Yes, you have to have one equation for each unknown. One unknown is the time of intercept. The other is what direction to fire. Assuming you are using a velocity vector then in 2D that is two unknowns and in 3D that is three unknowns, i.e. the x, y and z components of that vector. The magnitude of that vector is a constant (the velocity of the missle) and gives you the third or fourth equation you need for solving the problem. The magnitude is sqrt(x^2+y^2) in 2D and sqrt(x^2+y^2+z^2) in 3D. When you say A*T^2+B*T+C where A, B and C are vectors that is actually as many equations as there are components to the vector. A.x, B.x and C.x are the coefficents for one equation, A.y, B.y and C.y are the coefficents for another and A.z, B.z and C.z the coefficents for another. Within 2D the .z coefficents are always zero so Z=0*T^2+0*T+0 or Z=0.

The reason I didn''t post the solution is that it isn''t practical. There has to be a simplier solution. I just haven''t had time to play with it and figure out what that simplier solution is.
Keys to success: Ability, ambition and opportunity.
can u state more clearly what your trying to do and what your variables mean?
well i figured it out, but i''d like to simplify it somehow. i need a way to solve 4th degree polynomials. lilbudywizer and everyone else, thanks for your time & help.

my solution (im not sure if this is what lilbudywizer did) :


x^2 + y^2 + z^2 = vt^2

ax t ^ 2 + bx t + cx = x
ay t ^ 2 + by t + cy = y
az t ^ 2 + bz t + cz = z

(ax t ^ 2 + bx t + cx)^2 + (ay t ^ 2 + by t + cy)^2 + (az t ^ 2 + bz t + cz)^2 = 900t^2
Advertisement
would using matrix improve it speed wise?
im not sure, im not too good with matrices, if it does, it would be nice if someone showed how.
I think the 900 should be squared as well. v*t would be the distance travelled so assuming it was starting at the origin then x^2+y^2+z^2=(v*t)^2. MathCAD crashed and exited on trying to find the solution. Mathimatica found the solution and it was better than what I''ve had so far. It was only about a page per solution rather than the original 25 or the 10 I got it down to. Below is the solution:

Sorry about that, forgot to put my userid on it so I couldn''t change it to a referance. Also sorry about the format, but I can''t figure out if I can tell Mathimatica to change the width much less how.
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement