The simFlight Network Forums

# Detecting the position of aircraft on runway

## Recommended Posts

Hi all,

I am writing a Flight Data Recorder for FS9 and I need to know if the user aircraft is in runway or not.I got all the information of runways out of FS with MakeRwys.But I don't know how to use these data.How should I write an equation which could tell me if the aircraft is on runway or not?

P.S: I am using VB.NET.

Thank You,

##### Share on other sites

I am writing a Flight Data Recorder for FS9 and I need to know if the user aircraft is in runway or not.I got all the information of runways out of FS with MakeRwys.But I don't know how to use these data.How should I write an equation which could tell me if the aircraft is on runway or not?

You need to use the runway centre Lat/Lon, its true heading, and its width and length to compute the Lat/Lon coordinates of the four corners, then see if the aircraft position lies within them. It is mostly simple arithmetic and a little simple trigonometry. Draw yourself a little diagram and you'll see how to work it out.

Sorry, I really haven't got time to work it all out for you. If you are really stuck maybe someone will jump it, but otherwise, for general programming questions like this, you might get more detailed answers posting on one of the programming-oriented forums, maybe over at Avsim?

Regards

Pete

##### Share on other sites

Is there anyone who can help me to get the correct equation for calculating the four corners of the runway with the data I get from MakeRwys and check if the aircraft is on runway or not?

Thanks,

##### Share on other sites

There is some mathematical techniques to determine whether a point is inside a polygon. have a look here

http://alienryderflex.com/polygon/

http://local.wasp.uwa.edu.au/~pbourke//nsidepoly/

Alternatively, you can try to use surface type FSUIPC information at offset x31E8. Withe some precautions, it can help determining if the aircraft is on or off the runway. However some third party sceneries may lead to deceptive results.

Regards

Hervé

## Create an account

Register a new account