help: direction to hit a moving target?
a t ^ 2 + b t + c = the trajectory of a moving target
900 units / sec = velocity of a missle (goes in a straight line)
what is the closest point on the traj i should aim for to hit it with the missle?
or
100/s = velocity of a target (moves straight)
110/s = velocity of a missle (moves straight)
at what time could they collide?
Edited by - youngo on April 11, 2001 9:49:18 AM
Um ... the origin? ![](smile.gif)
This looks suspiciously like maths homework and has brought back many bad memories. Not enough bad memories to be able to help though; I have a feeling more information is required
(Oh, and technically, by definition a line is straight
- just being pedantic)
--
![](smile.gif)
This looks suspiciously like maths homework and has brought back many bad memories. Not enough bad memories to be able to help though; I have a feeling more information is required
(Oh, and technically, by definition a line is straight
![](wink.gif)
--
April 11, 2001 06:21 AM
quote:
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..
I think they were looking for the origin not aiming for it.
"There is humor in everything depending on which prespective you look from."
"There is humor in everything depending on which prespective you look from."
"There is humor in everything depending on which prespective you look from."
Generally that equation is the position of an accelerated particle on a trajectory and not it''s trajectory. Normally you would have two or three equations for the path depending upon whether the motion is in two or three dimensions. That could be done by making a, b and c vectors where a would be the acceleration, b would be the initial velocity and c would be the initial position. Within 2D those vectors would have two components and in 3D they would have three.
At a given time there is only two places you can aim on the trajectory and hit the target with a constant acceleration assuming the target is just a point. You find that point by saying that the x coordinate of the target and missile will be the same or a.x*t^2 + b.x*t + c.x = 900*cos(theta). You then either solve it for t or theta. Solving for t it would be t = (-b.x +/- sqrt(b.x^2 - 4*a.x*c.x + 3600*a.x*cos(theta))) / 2*a.x. Substituting these for t in a.y*t^2 + b.y*t + c.y = 900*sin(theta) gives you an equation in terms of theta which can be solved for theta. This gives you two solutions. Those solutions may both be positive, both negative or one positive and one negative. The negative ones are invalid solutions. If you have two positive ones you want the one that gives the lowest t.
At a given time there is only two places you can aim on the trajectory and hit the target with a constant acceleration assuming the target is just a point. You find that point by saying that the x coordinate of the target and missile will be the same or a.x*t^2 + b.x*t + c.x = 900*cos(theta). You then either solve it for t or theta. Solving for t it would be t = (-b.x +/- sqrt(b.x^2 - 4*a.x*c.x + 3600*a.x*cos(theta))) / 2*a.x. Substituting these for t in a.y*t^2 + b.y*t + c.y = 900*sin(theta) gives you an equation in terms of theta which can be solved for theta. This gives you two solutions. Those solutions may both be positive, both negative or one positive and one negative. The negative ones are invalid solutions. If you have two positive ones you want the one that gives the lowest t.
Keys to success: Ability, ambition and opportunity.
April 11, 2001 12:48 PM
what would i do i dont know theta?
quote:
Original post by LilBudyWizer
At a given time there is only two places you can aim on the trajectory and hit the target with a constant acceleration assuming the target is just a point. You find that point by saying that the x coordinate of the target and missile will be the same or a.x*t^2 + b.x*t + c.x = 900*cos(theta). You then either solve it for t or theta. Solving for t it would be t = (-b.x +/- sqrt(b.x^2 - 4*a.x*c.x + 3600*a.x*cos(theta))) / 2*a.x. Substituting these for t in a.y*t^2 + b.y*t + c.y = 900*sin(theta) gives you an equation in terms of theta which can be solved for theta. This gives you two solutions. Those solutions may both be positive, both negative or one positive and one negative. The negative ones are invalid solutions. If you have two positive ones you want the one that gives the lowest t.
April 11, 2001 12:48 PM
what would i do i dont know theta and t?
i want to find theta and t
i want to find theta and t
quote:
Original post by LilBudyWizer
At a given time there is only two places you can aim on the trajectory and hit the target with a constant acceleration assuming the target is just a point. You find that point by saying that the x coordinate of the target and missile will be the same or a.x*t^2 + b.x*t + c.x = 900*cos(theta). You then either solve it for t or theta. Solving for t it would be t = (-b.x +/- sqrt(b.x^2 - 4*a.x*c.x + 3600*a.x*cos(theta))) / 2*a.x. Substituting these for t in a.y*t^2 + b.y*t + c.y = 900*sin(theta) gives you an equation in terms of theta which can be solved for theta. This gives you two solutions. Those solutions may both be positive, both negative or one positive and one negative. The negative ones are invalid solutions. If you have two positive ones you want the one that gives the lowest t.
That was how to find t and theta. You can solve for two variables with two equations and three variables with three equations. Using a simple example take x+y=4 and x-y=2. Solving the first one for x gives x=4-y. Using that value for x in the second equation gives (4-y)-y=2 -> 4-2y=2 -> 2y=4-2 -> 2y=2 -> y=2/2 -> y=1. Using that value for y in the first equation gives x+1=4 -> x=4-1 -> x=3. These are simple equations compared to the ones you are dealing with. The equations I gave were wrong and should be a.x * t^2 + b.x * t + c.x = vm * cos(theta) * t + mp.x and a.y * t^2 + b.y * t + c.y = vm * sin(theta) * t + mp.y. You can solve either of those for t or theta. If you solve for t then you have an equation in terms of theta. You can then substitute that equation for t into the other equation everywhere that t occurs and solve for theta. That will then give you a numeric value for theta. Using that numeric value for theta back in the equation for t in terms of theta will give you the value for t. Theta or what direction to fire the missile is the value you need though.
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.
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.
Keys to success: Ability, ambition and opportunity.
quote:
Original post by youngo
a t ^ 2 + b t + c = the trajectory of a moving target
900 units / sec = velocity of a missle (goes in a straight line)
what is the closest point on the traj i should aim for to hit it with the missle?
or
100/s = velocity of a target (moves straight)
110/s = velocity of a missle (moves straight)
at what time could they collide?
Edited by - youngo on April 11, 2001 9:49:18 AM
OK, in your first equation, the acceleration should be 0, correct? Neither your missile or your target is accelerating, is it? Unless you''re working in a gravity situation, it shouldn''t be.
April 11, 2001 10:49 PM
quote:
Original post by LilBudyWizer
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.
can you post the solution?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement