# Find the point of collision

Tags:
1. May 19, 2015

### HuePig

I have 2 objects:
Obj1 have a Velocity of vel1 and position of (x1, y1)
Obj2 have a Velocity of vel2 and position of (x2, y2)
Using time = distance / velocity knowing that they will collide.. can I assume distance1 / vel1 = distance2 / vel2 ?
distance formula = sqrt((x - x1^2) + (y - y1^2))
Can I find the collision point(x, y) from the given and how?

2. May 19, 2015

### jbriggs444

Yes, $\frac{{distance}_1}{{vel}_1}$ will be equal to $\frac{{distance}_2}{{vel}_2}$ because both will be equal to elapsed time until the collision. But that does not help you much. Mathematically, the solution set of collision positions that fit that equation will be a line between the starting point of object1 and the starting point of object 2 so that the ratio of the distance to each starting point is the same as the ratio of the velocities.

Edit: There is the minor problem that you are dividing a scalar by a vector yielding a scalar. But one assumes that you are dividing by speed rather than velocity. So that concern goes away.

There are a number of ways to solve this problem. The first step is a better set of variable names. You have position as (x_1,y_1) and (x_2,y_2). But you have velocity as vel_1 and vel_2. That's inconsistent -- expressing position in terms of coordinate pairs and velocity in terms of vectors. Pick one notation and stick to it.

[Sometimes simply coming up with a notation that works so that you can write down the relevant equations is 90% of the problem]

For instance, how about position as (x1, y1) and (x2, y2) and velocity as (vx1,vy1) and (vx2, vy2).

Then you can write a formulas for the x coordinate of object 1 as a function of time (t), the y coordinate of object 1 as a function of time, the x coordinate of object 2 as a function of time and the y coordinate of object 2 as a function of time. You know that at the time of the collision, the x coordinates will be equal and the y coordinates will be equal. That leads to two equations. Write them down.

Two linear equations in one unknown... You should be able to solve at least one of them for the time (t) at which the collision occurs. Given starting position, velocity and time until the collision, it should them be possible to predict the position of the collision easily.