PDA

View Full Version : Motion of objects collide


adoado
Jun28-09, 10:46 AM
Hello all ^^

I have two objects moving in 2d space, their positions given by:

x1 = r1*cos(s1 * time)
y1 = r1*sin(s1 * time)

and

x2 = r2*cos(s2 * time)
y2 = r2*sin(s2 * time)

Essentially, I want to see if they collide or exist in the same place at any time. So I am guessing I need to solve twice for both x and y collisions.

I did this, but am stuck isolating time (or solving the problem :P)....

r1*cos(s1 * time) = r2*cos(s2 * time)

I am trying to isolate the time they collide (if they do)...

I am not too good at maths, and the answer is probably really simple, but any help is greatly appreciated! This is not homework, its for a hobby computer game I am trying to make.

Cheers,
Adrian

tiny-tim
Jun28-09, 04:05 PM
I have two objects moving in 2d space, their positions given by:

x1 = r1*cos(s1 * time)
y1 = r1*sin(s1 * time)

and

x2 = r2*cos(s2 * time)
y2 = r2*sin(s2 * time)

Essentially, I want to see if they collide or exist in the same place at any time.

Hello Adrian! :smile:

These are circles, with radius r1 and r2, respectively, and both centred at the origin (0,0).

So the objects won't collide unless r1 = r2 :wink: