Converting x and y values into lat and long
-
i’m having a really hard time converting x and y from the flightdata to lat and long. i have it close but there is a skew in the longitude of 2.9deg to the north east it seams but its more complex than that.
if anyone could send me a formula or a bit of code, much appreciated
thx
-
i worked it out with a little help from the free falcon source
const float FALCON_ORIGIN_LAT = 33.844031F; // DEF_LAT;
const float FALCON_ORIGIN_LONG = 123.0F; //DEF_LONG;
const float RTD = 57.2957795F;
const float DTR = 0.01745329F;
const float EARTH_RADIUS_NM = 3443.92228F; //Mean Equatorial Radius
const float EARTH_RADIUS_FT = 2.09257E7F; //Mean Equatorial Radius
const float NM_PER_MINUTE = 1.00018F; //Nautical Mile per Minute of Latitude (Or Longitude at Equator)
const float MINUTE_PER_NM = 0.99820F; //Minutes of Latitude (or Longitude at Equator) per NM
const float FT_PER_MINUTE = 6087.03141F; //Feet per Minute of Latitude (Or Longitude at Equator)
const float MINUTE_PER_FT = 1.64283E-4F; //Minutdes of Latitude (or Longitude at Equator) per foot
const float FT_PER_DEGREE = FT_PER_MINUTE * 60.0F;void convertXYtoLatLon(int x, int y, float& lat, int& latd, float& latm, float& lon, int& lond, float& lonm)
{
// Kunsan center runway 36 is 35 57.550N 127 24.288E = x(772511) y(1302177)
lat = (FALCON_ORIGIN_LAT * FT_PER_DEGREE + x) / EARTH_RADIUS_FT;
lat = R2D(lat);
latd = (int)lat; latm = (lat-latd)*60;float cosLat = (float)cos(D2R(lat));
lon = ((FALCON_ORIGIN_LONG * DTR * EARTH_RADIUS_FT * cosLat) + y) / (EARTH_RADIUS_FT * cosLat);
lon = R2D(lon);
lond = (int)lon; lonm = (lon-lond)*60;
} -
Thanks, for your post, I need some other data :
const float FALCON_ORIGIN_LAT = 33.844031F; // DEF_LAT;
const float FALCON_ORIGIN_LONG = 123.0F; //DEF_LONG;
for ITO, Balkan and Ikaros theaters.