As you may know, Falcon 4 (and the most recent version, BMS) uses a technique called Shared Memory, to export real time telemetry data of your aircraft. This data can be used by other programs for various reasons, from simple ownship position display to building real cockpits interacting with the sim.
The aircraft position in the world of Falcon is exported as two numbers, specifically the aircraft’s distance North and East from the Southwest corner of the theater in feet.
Since, this is the position system used throughout the code, it has to be converted in order to be displayed as coordinates. Below is a sample code (in c++) that accomplishes the task.
#include <math.h> #define FT_PER_DEGREE 365221.8846f #define RTD 57.2957795f //Radians to Degrees #define DTR 0.01745329f //Degrees to Radians #define EARTH_RADIUS_FEET 20925700f //The Latitude and Longitude of the SW corner of the theater //in Degrees. Stored in MAP theater file. //These values are correct for Korean Theater. float StartCoord_Lat = 33.84375; float StartCoord_Long = 123; float ownship_North = 0; //Your input value in feet float ownship_East = 0; //Your input value in feet float cosLat = 0; //Temporary var float outCoordLat = 0; //Output Latitude float outCoordLong = 0; //Output Longitude //Latitude in Radians outCoordLat = ( StartCoord_Lat * FT_PER_DEGREE + ownship_North ) / EARTH_RADIUS_FEET //Cosine of Latitude cosLat = cos( outCoordLat ) //Longitude in Radians outCoordLong = ( ( StartCoord_Long * DTR * EARTH_RADIUS_FEET * cosLat ) + ownship_East ) / ( EARTH_RADIUS_FEET * cosLat ) //Converting to Degrees outCoordLat = outCoordLat * RTD outCoordLong = outCoordLong * RTD
As you can see, you will need another pair of values in order to make it work. These are the coordinates of the Southwest corner of the theater, since the position is relative to this point. This can easily be found by viewing the
theater.map file of your theater with the appropriate program.