
#1
Jul913, 12:01 PM

P: 4

Hello. I am new to these forums. I don't really know if this is the right place to post this, but here it goes.
I was thinking, what If there were two bodies (represented by points) in space (two dimensional space to keep it simple) with known position at time zero, where the first is moving at a known velocity and the second moving at an unknown velocity. There is, however, a restriction on the velocity of the second body: it can have any direction, however, it must have a specific speed, i.e. magnitude. Let Vf = velocity of the first body, Df = position of first body at time zero Let Vs = direction of the second body's velocity (unit vector), Ss = speed of the second body (magnitude of velocity), Ds = position of second body at time zero If Vf, Df, Ss, and Ds are known, how then can I determine Vs such that the two bodies collide in the shortest time possible? As well, how can I determine whether or not it is possible for the two bodies to collide? For example, if Vf ≥ Ss and Vf points away from Ds than the two bodies would have no chance of colliding no matter what Vs is, providing Vs = one. It seems to me that this may require calculus to solve, especially due to the parameter of the shortest time possible. This is the main reason why I am not sure whether this post should be in this forum or the calculus forum. Thank you for any help. 



#2
Jul913, 12:13 PM

P: 2,471

I think what you're asking about are pursuit curves:
http://en.wikipedia.org/wiki/Pursuit_curve Solving these require differential equations experience. 



#3
Jul913, 12:42 PM

P: 4

Yes, I think that this will allow me to solve my problem. So I was correct, calculus is required to do it.
The actual scope of the problem is a computer game where there is a moving target and you shoot it with a projectile. So with what direction do I fire at a given time to hit the moving target if the target maintains its velocity and the bullet has a constant speed and the bullet is to hit the target in the lowest amount of time possible? I think I can use pursuit curves to figure this out. Thank you 



#4
Jul913, 02:00 PM

Mentor
P: 10,766

Question about the collision of two objects (points) in space
With uniform motion, I don't see why you would need calculus, and the shortest interception always uses a straight line. If you calculate the difference between the two objects, you get a formula for a straight line in 3D space. You just have to adjust two parameters (for the direction) to let it hit the origin. There are at most two solutions.




#5
Jul913, 02:54 PM

P: 2,471





#6
Jul913, 08:07 PM

P: 4

Yes, the main issue is that the projectile moves at a specific speed at any direction but the target could be moving at any constant speed and direction.
 If you aimed directly at the target and shot, the target would be gone from its position when the projectile reaches there.  Even if you predict the target's future position based on the time the projectile would take to reach the target's original position, then aim towards this prediction, the time for the projectile to reach the predicted position would be different than the time used to predict that position: the target would not actually be there when the shot gets there. If you figure out where the target would actually be when the shot gets to the target's previously predicted position and then aim at this newly predicted position, the case would be the same. There would be one difference, however, I think: the distance between the shot and the actual target's position would get smaller each time you do this. This is the reason I believed calculus was required: the distance between the bullet and the target's position would approach zero as you did more predictions. It's like a limit I guess. Here is a diagram of what I'm trying to explain: 



#7
Jul913, 11:56 PM

P: 2,471

you could simulate it in your game by integrating the values:
x1,y1 is the position of object 1 x2,y2 is the position of object 2 vx1,vy1 is the velocity vector for object 1 vx2,vy2 is the velocity vector for object 2 v2 is the speed for object 2




#8
Jul1013, 03:35 AM

Mentor
P: 10,766

Let ##x_t## be the current position of the target (vector in 2D) and ##v## its velocity (again, a vector). Let ##x_b## be our current position and w be the magnitude of our velocity, define (sin θ, cos θ) as the direction we should go to. Note that this vector is normalized, so our velocity is w*(sin θ, cos θ). Our distance to the target is now $$\vec{d(t)}=\vec{x_t}+\vec{v}t  \vec{x_b}w t \left( \begin{array}{c} \sin \theta\\ \cos \theta\\ \end{array} \right)$$ Set d(t)=0 and solve the two equations for t and θ, and you are done. 



#9
Jul1013, 04:13 AM

P: 3,536




#10
Jul1013, 09:10 AM

P: 2,471

Here's a java processing (processing.org) sketch illustrating a pursuit curve computed in realtime:




#11
Jul1013, 09:34 AM

Mentor
P: 10,766

Well, a pursuit curve is not optimal (and can be far away from this, or even fail if our velocity is below the target velocity).




#12
Jul1013, 10:15 AM

P: 2,471





#13
Jul1013, 07:54 PM

P: 4

And @mfb, I am not quite sure how I can solve the equation for both variables. I know you can break it into the component equations but I don't see how you could eliminate a variable because the terms wtsinθ and wtcosθ contain both. 



#14
Jul1113, 06:05 AM

Mentor
P: 10,766

Multiply the first equation with d and the second with b: 0=ad + bdt + d sinθ and 0=bc + bdt + b cosθ Now subtract both: 0=ad  bd + d sinθ  b cosθ This is an equation with one unknown variable only. It can be solved with various methods to combine sin and cos. 


Register to reply 
Related Discussions  
Points, Lines, and Planes in 3D Space! Given 3 points find a plane...  Calculus & Beyond Homework  10  
Length contraction (objects & space or objects only)  Special & General Relativity  10  
Two Objects, Constant Acceleration, 1D Forces, Collision Question  Introductory Physics Homework  2  
Collision objects>>> Help please  Advanced Physics Homework  4  
Collision of two objects...  Introductory Physics Homework  1 