1. Junior Member
Join Date
May 2006
Location
Monaco
Posts
40

VOR position

Hello,
I would appreciate if somebody could tell me how to get in C variables the latitude and longitude position of a VOR selected by its frequency in NAV1 or NAV2, as well as an ADF beacon position.
The object is to calculate the distance using the GPS coordinates and the great circle formula, and to be able to create a virtual waypoint associated to a beacon.
Thanks
Jean-Pierre

2. RE: VOR position

If coding for FSX, you can possibly use these new token variables:

GPS_WP_NEXT_LAT,
GPS_WP_NEXT_LON,
GPS_WP_NEXT_ALT,

If coding for FS9, you could access the same variables directly from the XML tokens, using the technique described in a sticky post at the top of this forum.

Oh wait... I just reread your question more carefully. I'm not at all sure that is even possible, unless the tuned VOR happens to be the GPS_WP_NEXT_xxx ... :(

3. Junior Member
Join Date
May 2006
Location
Monaco
Posts
40

RE: VOR position

You are right, the variables you mention are OK if I have a flight plan, then a next waypoint, but not in my case when I use a RMI for instance.

I need to find the coordinates of a beacon defined by its frequency.

Jean-Pierre

4. Junior Member
Join Date
Nov 2005
Location
San Isidro, Buenos Aires, Argentina.
Posts
26

RE: VOR position

Hi,

Using XML GeoCalc functions you can determine the lat/lon of a tuned facility (VOR/DME/ILS):

First, register your a/c lat/lon position:
Then, using AVars, register the bearing to the facility, and calculate the Azimuth.
After that, notice the distance to the facility in nmiles (or feet).
You can find the resulting LatLon reading GeoCalcExtrapolatedLat/Lon,

http://forums.avsim.net/dcboard.php?...id=33879&page=

Doing own's lat/lon calculations (great circle) will give you positional differences because FS uses Geocalc functions for its own internal calcs, the same ones I'm speaking of. :-)

Tom

5. Junior Member
Join Date
May 2006
Location
Monaco
Posts
40

RE: VOR position

Hi Tom,
Soory for the late answer, I was out of home for a while.
My problem is not to find azimut and distance fro the VOR, but to create a target referenced by azimut and distance from a vald beacon. So, I need to read the coordinates of the beacon co create a new virtual beacon (the target).

Jean-Pierre

6. Junior Member
Join Date
Nov 2005
Location
San Isidro, Buenos Aires, Argentina.
Posts
26

RE: VOR position

Hi Jean Pierre,

Precisely what I've stated, so here is a pseudocode you can follow

1) Register Plane latitude and Longitude in vars, for example Lat=40.124 Lon=-75.134

2) Tune the desired beacon and using the RMI save an instant heading to the beacon (for example Hdg=90 -beware it must be true heading, use magvar var to convert) and instant distance, in nmiles, for example Ndist= 23.453

3) Doing a GeocalcLat1 with Lat, GeocalcLon1 with Lon, GeocalcAzimuth1 with Hdg and GeocalLenght with Ndist, read the resulting GeocalcExtrapolationLat and GeocalExtrapolationLon, those are the Lat and Lon coordinates of your beacon.

4) Now replace Plane latitude and longitude with your beacon lat/lon, and repeat step 3, using Hdg and Ndist that you want to apply from the beacon. Then in both GeoCalcExtrapolation you'll have the coordinates of your virtual beacon.

Tom

7. Junior Member
Join Date
May 2006
Location
Monaco
Posts
40

RE: VOR position

Thanks Tom,

I understand that this is one possibility to do it, but in fact it must be set before flight, and not in flight. It is what is called in french "vecteur additionnel" on military aircrafts like the Mirages and the Super Etendard. And it must work on VOR1, VOR2 and ADF.

Can you let mee know how you do a GeocalcLat1 with Lat, GeocalcLon1 with Lon, GeocalcAzimuth1 with Hdg and GeocalLenght with Ndist, read the resulting GeocalcExtrapolationLat and GeocalExtrapolationLon, those are the Lat and Lon coordinates of your beacon.

It's the first time I try to make such a gauge in C.

Thanks for the help.

Jean-Pierre
jp_langer@libello.com

8. Junior Member
Join Date
Nov 2005
Location
San Isidro, Buenos Aires, Argentina.
Posts
26

RE: VOR position

Jean-Pierre,

Well, if it has to be set before flight, then you HAVE to know the id of the beacons that you're going to flyby (for example, ENO could be the id of a VOR, CG one of a NDB, etc). You can search the default gps database using those ids and their latlon come easy; and afterwards you might calculate target vectors using the method I described before.
Those gps functions, including Geocalc set, are easier to acces through XML code rather than C although there are specific functions in C to retrieve their values; even you can find a pinned topic abouth this right on this forum. But it would require a long explanation and as I don't know your knowledge level in C/XML I wouldn't know how deep to go with my sentences so you can understand the whole thing.

Tom

9. Junior Member
Join Date
May 2006
Location
Monaco
Posts
40

RE: VOR position

Hi Tom,
Unfortunately I don't know how to program in XML.
My knowledge in C are quite basic, using FS macros.
I'll try to improve my C knowledge before attempting to make such a gauge. Once more thanks for the explanations.
Jean-Pierre

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•