Calculating if two objects will come within a given distance

AI Thread Summary
Calculating the closest approach between two objects with given initial positions and velocity vectors involves using linear functions to express their motion. The distance between the two objects can be derived using the distance formula, leading to a complex expression that can be simplified by taking the derivative with respect to time. A suggested approach is to analyze the motion from the perspective of one object, effectively reducing the problem's complexity by treating the other object as moving relative to it. This method allows for easier calculations of the closest distance and position of approach. Exploring this relative motion perspective may yield a more efficient solution for determining proximity in 2D space.
ferret_guy
Messages
18
Reaction score
0
I am having trouble calculating if two objects with initial positions and velocity vectors will come within a given distance of one another and if so calculating where the closest approach is. Can anyone point me in the right direction?

My initial thoughts are that both are linear functions where:
d=tv
y=tv(cos \theta )+y_{i}
x=tv(sin \theta)x_{i}
The distance is:
d = \sqrt {( {x_1 - x_2 })^2 +( {y_1 - y_2 })^2}
Expanding to:
d = \sqrt {( {(tv_{2}sin \theta_{2}+x_{2_{i}})- (tv_{1}sin \theta_{1}+x_{1_{i}}) })^2 +( {(tv_{2}cos \theta_{2}+y_{2_{i}})- (tv_{1}cos \theta_{1}+y_{1_{i}}) })^2 }
My next thought is to take the derivative with respect to time to find the turning point of the graph and thus the closest approach to one another. If the turning point is when t is negative then t0 is the closest approach and if it is greater than t0 then the value is the closest approach
 
Last edited:
Physics news on Phys.org
explain your problem with proper velocities?
 
I am writung some software for quadcopters and I need to be able to see if they will come within some distance of one another I think the best solution is to just find the closet approach. Only need a 2d solution as they are all on the same plane
 
After using wolfram mathematica I have found that the differential is:
\left(\frac{2 \left(v_2 \sin \left(\theta _2\right)-v_1 \sin \left(\theta _1\right)\right) \left(-x_{1_i}+x_{2_i}-t v_1 \sin \left(\theta _1\right)+t v_2 \sin \left(\theta _2\right)\right)+2 \left(v_2 \cos \left(\theta _2\right)-v_1 \cos \left(\theta _1\right)\right) \left(-y_{1_i}+y_{2_i}-t v_1 \cos \left(\theta _1\right)+t v_2 \cos \left(\theta _2\right)\right)}{2 \sqrt{\left(-x_{1_i}+x_{2_i}-t v_1 \sin \left(\theta _1\right)+t v_2 \sin \left(\theta _2\right)\right){}^2+\left(-y_{1_i}+y_{2_i}-t v_1 \cos \left(\theta _1\right)+t v_2 \cos \left(\theta _2\right)\right){}^2}}\right)

and solving for when d/dt =0 gives:
\frac{v_1 \left(-\sin \left(\theta _1\right)\right) x_{1_i}+v_2 \sin \left(\theta _2\right) x_{1_i}+v_1 \sin \left(\theta _1\right) x_{2_i}-v_2 \sin \left(\theta _2\right) x_{2_i}-v_1 \cos \left(\theta _1\right) y_{1_i}+v_2 \cos \left(\theta _2\right) y_{1_i}+v_1 \cos \left(\theta _1\right) y_{2_i}-v_2 \cos \left(\theta _2\right) y_{2_i}}{v_1^2 \sin ^2\left(\theta _1\right)+v_2^2 \sin ^2\left(\theta _2\right)-2 v_2 v_1 \sin \left(\theta _1\right) \sin \left(\theta _2\right)+v_1^2 \cos ^2\left(\theta _1\right)+v_2^2 \cos ^2\left(\theta _2\right)-2 v_2 v_1 \cos \left(\theta _1\right) \cos \left(\theta _2\right)}

and knowing that it only equals zero in one location I can solve for that point in time to find the closest distance and position of closest approach. Seems like there could be a better way, and if done in 3d would give even more ridiculous results. Is there a better way?
 
ferret_guy said:
I am having trouble calculating if two objects with initial positions and velocity vectors will come within a given distance of one another and if so calculating where the closest approach is. Can anyone point me in the right direction?

well suppose in the plane there are two vehicles each located by a position and velocity vector
say at r(1) and r(2) there velocity being v(1) and v(2) at time t=t(1);
i do not know but if you are sitting on one and observing the closest approach - why don't you apply a reverse velocity to your self as well as the other one- so you go to rest and the body (other) has a net velocity v(1) + v(2) a vector addition.
the distance between 1 and 2 is r= r(1)- r(2) a vector addition at t=t(1) initial time.
so if you analyse the motion of 2 with respect to 1 and minimize the distance as time advances ,i think you can get a way out...how do you feel about this approach?
 
ferret_guy said:
Seems like there could be a better way
As drvrm said, choosing the rest frame of one of the objects reduces the mathematical complexity of such problems.
 
Thread 'Question about pressure of a liquid'
I am looking at pressure in liquids and I am testing my idea. The vertical tube is 100m, the contraption is filled with water. The vertical tube is very thin(maybe 1mm^2 cross section). The area of the base is ~100m^2. Will he top half be launched in the air if suddenly it cracked?- assuming its light enough. I want to test my idea that if I had a thin long ruber tube that I lifted up, then the pressure at "red lines" will be high and that the $force = pressure * area$ would be massive...
I feel it should be solvable we just need to find a perfect pattern, and there will be a general pattern since the forces acting are based on a single function, so..... you can't actually say it is unsolvable right? Cause imaging 3 bodies actually existed somwhere in this universe then nature isn't gonna wait till we predict it! And yea I have checked in many places that tiny changes cause large changes so it becomes chaos........ but still I just can't accept that it is impossible to solve...
Back
Top