2d targeting

Started by
11 comments, last by Argus 21 years, 5 months ago
I did the analysis in 2D and it''s very simple but is it much more complicated in 3D?

What I thought:

The target particle will be travelling in a certain direction that we know. If we fire the intercepting particle along the same plane then the analysis becomes simple 2D trigonometry. We also have to fire it in the same plane for an intercept to be possible. Then we just have a triangle with all sides and angles known except for our one angle we are trying to assertain. If we plug in all the numbers and we get a number greater than 1 or less than -1 for our arccos calculation then we know intercept is not possible (am I right here) else we get an angle out and voila.

-Meto
Advertisement
The idea is to represent objects positions as a function of time.

Say you have object a with initial position Xa0, Ya0, speed Va and direction (angle) alpha; then its position at any moment of time t is:

Xa = Xa0 + Va * cos(alpha) * t
Ya = Ya0 + Va * sin(alpha) * t

The other object has its own position, speed and angle and its equations will look similar:

Xb = Xb0 + Vb * cos(beta) * t
Yb = Yb0 + Vb * sin(beta) * t

You are trying to find beta (angle) and t (time) that would satisfy the system:
Xa = Xb
Ya = Yb

I tried to solve it for you but I got lost in calculations and got some results which are probably wrong cause they''re too complicated
quote:The target particle will be travelling in a certain direction that we know. If we fire the intercepting particle along the same plane then the analysis becomes simple 2D trigonometry. We also have to fire it in the same plane for an intercept to be possible. Then we just have a triangle with all sides and angles known except for our one angle we are trying to assertain. If we plug in all the numbers and we get a number greater than 1 or less than -1 for our arccos calculation then we know intercept is not possible (am I right here) else we get an angle out and voila.

That''s a good gist of the situation, but the problem is that the actual position of the object is a function of time. As long as the "bullet" is fired towards the "target''s" trajectory on the same plane, then we know that at some point their trajectories will intersect, but that says nothing but whether the objects themselves intersect. Out problem is trying to find a time for both projectiles and a direction for the "bullet" that will give equal positions for the same time value. Eventually, the solution will look like a triangle, but since position is a function of time, we are missing the angle and the length of two sides. We have too many unknowns for a simple 2D analysis.

What we have to do is then say that time is a dimension, and throw that in there as a Z. Now, we have the position of the "target" as a function of Z, which is a 3D line, and the position of the "bullet" as a function of Z. However, since we still don''t know the direction of the "bullet," at any given Z value we can have a circle whos radius represents the absolute distance the "bullet" can be from it''s initial point. So as Z increases, the radius of the circle increases, and we have the surface area of a cone. As long as the "target" isn''t constantly fleeting from the "bullet," there will be a intersection between the surface of this cone and the line that represents the position of the "target." As a matter of fact there can be two possible points of intersection, since a line can intersect a cone at a maximum of two points. The trick then is to find the time value where the line will intersect the cone only once, at the cone''s bottom, circular edge.

My suggestion would be to use a cone-line intersection method. For your cone, selection a super high-time value and find the radius of the cone at that time. Once you actually have a large, discrete cone to work with, you can use the cone-line intersection method to find where the cone intersects the line. The Z point where they intersect will be the time, the X and Y...well, the position (), and you can work backwards from there to find out what direction that point is from the "bullet." Now, since the line can intersect at more than one point, you can chose either one, but my guess is that you''d want to chose the first one with the lesser Z.

Sorry, it''s about time I finally got around to articulating everything

This topic is closed to new replies.

Advertisement