Home Products Download Order Contacts

comp.graphics.algorithms

Subject: Re: How to get angle and speed to reach a movable point



staryon@gmail.com wrote:

> Let´s consider that A is in (0,0) and B in (0,100). If B starts
> moving south they will meet eventually.

> Another example is the following. A is in (0,0) and B in (50,100). If B
> starts moving southwest, there will be a moment that it will be very
> close to A (it doesn´t have to be 0,0)
> If A starts moving towards that direction even if its speed is slower,
> it will catch B.

> Does you algorithm include that condition?

No, as a matter of fact, it doesn't. That's because the equation

B'^2 + C'^2 = A'_max^2

is wrong --- there's no need for C' to be orthogonal to B'.

OK, second try.

(B - A) = t * (A' - B')
A'^2 = A'_max^2
t >= 0
t = min!

Isolate A' in the first equation, square and use the third equation,
and you get a quadratic equation in t:

(B'^2-A'_max^2)*t^2 + 2*t*(B-A).B' + (B-A)^2 = 0

Solve that, if possible, picking the smaller t if there are two
solutions. Substitute the result in the first equation, and you get
A'.



--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Reply


View All Messages in comp.graphics.algorithms

path:
How to get angle and speed to reach a movable point =>Re: How to get angle and speed to reach a movable point =>Re: How to get angle and speed to reach a movable point =>Re: How to get angle and speed to reach a movable point =>Re: How to get angle and speed to reach a movable point =>Re: How to get angle and speed to reach a movable point =>

Replies:
Re: How to get angle and speed to reach a movable point
Re: How to get angle and speed to reach a movable point
Re: How to get angle and speed to reach a movable point

Copyright 2006 WatermarkFactory.com. All Rights Reserved.