PDA

Click to See Complete Forum and Search --> : I need help with bearing and range for flight simulator


bafstuff
Jan 7th, 2001, 02:28 AM
I am writing a flight simulator type game and I can't seem to figure out how to get an accurate bearing and range to other aircraft. I am using just the basic x and y screen coordinates. I have VB 5.0 and would like all the help I can get.

Caleb
Jan 7th, 2001, 07:13 PM
Try using the Cosine and sine method for the bearing
It should Help.
Any way here's a simple help for the range of aircrafts.

E
|\
o| \h
| \
X----Y
a

Above is a triange

E is aircraft 1
Y is aircraft 2
OK?
Now using Tearum Pithogarus, You can get b, the distance bettween E and Y by this formular. h^=o^+a^
then You squar root it. In vb I think it's Like this. Sqr(b)

There you got your distance.

HarryW
Jan 7th, 2001, 07:28 PM
I think that was meant to look like this:

E
|\
o| \h
| \
X----Y
a

bafstuff
Feb 2nd, 2001, 10:52 PM
Thanks for the help guys. I was finnaly able to get the bearing and range to work the way I want it to. The Cosine and Sine functions fixed the problem.