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><br /> #define FT_PER_DEGREE 365221.8846f<br /> #define RTD 57.2957795f //Radians to Degrees<br /> #define DTR 0.01745329f //Degrees to Radians<br /> #define EARTH_RADIUS_FEET 20925700f</p> <p>//The Latitude and Longitude of the SW corner of the theater<br /> //in Degrees. Stored in MAP theater file.<br /> //These values are correct for Korean Theater.<br /> float StartCoord_Lat = 33.84375;<br /> float StartCoord_Long = 123;<br /> float ownship_North = 0; //Your input value in feet<br /> float ownship_East = 0; //Your input value in feet</p> <p>float cosLat = 0; //Temporary var</p> <p>float outCoordLat = 0; //Output Latitude<br /> float outCoordLong = 0; //Output Longitude</p> <p>//Latitude in Radians<br /> outCoordLat = ( StartCoord_Lat * FT_PER_DEGREE + ownship_North ) / EARTH_RADIUS_FEET<br /> //Cosine of Latitude<br /> cosLat = cos( outCoordLat )<br /> //Longitude in Radians<br /> outCoordLong = ( ( StartCoord_Long * DTR * EARTH_RADIUS_FEET * cosLat ) + ownship_East ) / ( EARTH_RADIUS_FEET * cosLat )<br /> //Converting to Degrees<br /> outCoordLat = outCoordLat * RTD<br /> 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.