Object following object

Started by
1 comment, last by Thrump 22 years, 2 months ago
I''m having trouble solving this problem. Object1(O1) is travelling in a straight line. Object2(O2) is always travelling towards O1. What is O2''s position at any given time? Here''s what I have so far: O2''s dx = cos(atan( (O1y-O2y)/(O1x-O2x) )) O2''s dy = sin(atan( (O1y-O2y)/(O1x-O2x) )) It''s been a few years since I''ve done anything like this (actually, maybe I never did). Any suggestions?
Advertisement
A solution (tractrice)

O1(t, 0)
O2(t - tanh(t), 1 / cosh(t))

Edit: conditions
O1 starts in (0,0), moves along Ox
O2 starts in (0,1), moves at the same speed than O1

Edited by - Fruny on January 29, 2002 1:45:19 PM
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Thx for the reply.

I eventually found this:

http://mathworld.wolfram.com/PursuitCurve.html

It is only if the 2 objects are moving at the same speed, but I may be able to come up with something.

This topic is closed to new replies.

Advertisement