![]() |
#41 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: ,
Posts: 4,614
|
![]() Damn you not another one!
OK I'm not sure about what you mean. What I've understood is that from your old position you are to steer to a new heading, then advance in a straight line along it. And what you want to know is that heading and the distance you are to advance. Am I correct?
__________________
Life starts every day anew. Prospects not so good... |
||
![]() ![]() |
|
![]() |
#42 | ||
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: Krakeroy, Norway
Posts: 3,014
|
![]() Quote:
Yes, from the old position located at [e d] you are to turn to a new heading and move along a straight line to a new location [B D]. The question is what will the new heading be, how many degrees to port or starboard is that new heading from your current one, and how far do you need to travel. IRL: In military aviation, positions are given by comparing your position to a known, fixed position (the Point in this problem). Your relative position is given as two numbers, one for the bearing seen from the fixed location, the other for the distance in nautical miles from that same location. You know your position and you are told there is an unknown aircraft at a different location and you are ordered to intercept. You now need to know which new heading you need to take, the distance to target as well as which direction will give the smallest turn angle (say, for instance, your current heading is 360 and your new heading is 270, then a 90 degrees turn to port is quicker than a 270 degrees turn to starboard).
__________________
Je Suis Charlie |
||
![]() ![]() |
|
![]() |
#43 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: ,
Posts: 4,614
|
![]() The easiest way to solve one of these problems is expressing each position as a vector. Then getting the bandit's position relative to yourself is as easy as substracting your position relative to the base from the bandit's position relative to the base. Adding vectors is graphically equivalent to linking them one after the other. (Substracting a vector is merely adding its opposite, for example -OA = AO.)
Adding or substracting vectors is as easy as adding or substracting all their cartesian coordinates respectively. Since you have both vectors in polar coordinates (distance and bearing), you need to convert them from polar to cartesian, then substract them, and then you'll probably want to convert the result back to polar, since it's more useful that way. These drawings (click to enlarge) show this, point O being the base, A your craft, and B the bandit. The one to the left shows that the bandit's position relative to you (AB) equals the difference between the bandit's position relative to the base (OB) and your position relative to the base (OA). To the right you can see the relationships between polar (distance, bearing) and cartesian (x, y) coordinates for any of the vectors. (Here the bearing is measured clockwise from the north, although the usual convention in geometry is measuring angles anti-clockwise from the horizontal axis, and the formulae would be changed.) ![]() Many hand calculators will do all this seamlessly, you just input both vectors in polar coordinates and substract them and the conversions will be made internally. (Some not so advanced calculators can't handle vectors of arbitrary dimension, but some can handle complex numbers and these can be equivalent to 2-D vectors.) You could easily program all the calculations into a computer program. Especially since you want to get automatically even whether to turn to port or starboard. For example a routine to calculate it could be something like this (in pseudocode, it's not in any specific language), being h1 your current heading and h2 the one you must take (that is the bearing of vector AB, of the bandit relative to you): Code:
turn := h2 - h1 if turn = 0 then output("You are heading straight at it.") ; EXIT else if abs(turn) = 180 then output("It is right behind you.") ; EXIT else if turn > 180 then turn := turn - 360 else if turn < -180 then turn := turn + 360 output("You must turn %abs(turn)% degrees ") if turn > 0 then output("to the right.") else output("to the left.") Anyway I think an expericed pilot would know by himself which way to turn the moment he learns the heading.
__________________
Life starts every day anew. Prospects not so good... Last edited by Japo; 28-09-2008 at 10:17 AM. |
||
![]() ![]() |
|
![]() |
#44 | ||
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: Krakeroy, Norway
Posts: 3,014
|
![]() True, when you get the new heading, turning isn't hard to figure out, but I'm more interested in the maths behind it.
Another thing is, learning this positioning system takes a while when you're used to think in terms of x/y axis. As for the distance d, one equation is d = sq.r. (a^2 + b^2 - 2ab cos(alpha-beta)) where a and b are the distance element in the two coordinates and alpha and beta are the two bearing elements.
__________________
Je Suis Charlie |
||
![]() ![]() |
|
![]() |
#45 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: ,
Posts: 4,614
|
![]() Quote:
![]() Otherwise maths would lie. :P Same goes for the angle.
__________________
Life starts every day anew. Prospects not so good... |
||
![]() ![]() |
|