Doug Posted August 16, 2006 Share Posted August 16, 2006 Hi ! I'm working to build a complete navigation system. I have a problem with the x,y,z position of waypoints. How have the position of my aircraft with the same x,y,z system ? I only have a function wich give me LatLongAlt but no x,y,z. LoGetRoute() -- (args - 0,results = table) get_route_result = { goto_point, -- next waypoint route -- all waypoints of route (or approach route if arrival or landing) } waypoint_table = { this_point_num, -- number of point ( >= 0) world_point = {x,y,z}, -- world position in meters speed_req, -- speed at point m/s estimated_time, -- sec next_point_num, -- if -1 that's the end of route } Regards LOTATC .NET // LOVICA .NET // 3rd Wing Link to comment Share on other sites More sharing options...
ED Team Alex Okean Posted August 16, 2006 ED Team Share Posted August 16, 2006 Hi ! I'm working to build a complete navigation system. I have a problem with the x,y,z position of waypoints. How have the position of my aircraft with the same x,y,z system ? I only have a function wich give me LatLongAlt but no x,y,z. LoGetRoute() -- (args - 0,results = table) get_route_result = { goto_point, -- next waypoint route -- all waypoints of route (or approach route if arrival or landing) } waypoint_table = { this_point_num, -- number of point ( >= 0) world_point = {x,y,z}, -- world position in meters speed_req, -- speed at point m/s estimated_time, -- sec next_point_num, -- if -1 that's the end of route } Regards sorry it's our mistake , ( i forgot to add this routines to 1.12 export , they are will be available in BS) but try to use this code float MapCoords::zeroX = 5000000.f; float MapCoords::zeroZ = 6600000.f; // data for recalculation float MapCoords::centerX = 11465000.f - zeroX; // circle center float MapCoords::centerZ = 6500000.f - zeroZ; float MapCoords::pnSxW_X = 4468608.57f - zeroX; // point 40dgN : 24dgE float MapCoords::pnSxW_Z = 5730893.72f - zeroZ; float MapCoords::pnNxW_X = 5357858.31f - zeroX; // point 48dgN : 24dgE float MapCoords::pnNxW_Z = 5828649.53f - zeroZ; float MapCoords::pnSxE_X = 4468608.57f - zeroX; // point 40dgN : 42dgE float MapCoords::pnSxE_Z = 7269106.20f - zeroZ; float MapCoords::pnNxE_X = 5357858.31f - zeroX; // point 48dgN : 42dgE float MapCoords::pnNxE_Z = 7171350.00f - zeroZ; // double MapCoords::lenNorth = sqrt((pnNxW_X-centerX)*(pnNxW_X-centerX) + (pnNxW_Z-centerZ)*(pnNxW_Z-centerZ)); double MapCoords::lenSouth = sqrt((pnSxW_X-centerX)*(pnSxW_X-centerX) + (pnSxW_Z-centerZ)*(pnSxW_Z-centerZ)); double MapCoords::lenN_S = lenSouth - lenNorth; double MapCoords::RealAngleMaxLongitude = atan (((double)pnSxW_Z - centerZ)/(pnSxW_X - centerX)) * 180.f / PI; // borders float MapCoords::EndWest = 24.f; float MapCoords::EndEast = 42.f; float MapCoords::EndNorth = 48.f; float MapCoords::EndSouth = 40.f; float MapCoords::MiddleLongitude = (EndWest + EndEast) / 2; float MapCoords::ToLengthN_S = (float)((EndNorth - EndSouth) / lenN_S); double MapCoords::ToAngleW_E = (MiddleLongitude - EndWest) / RealAngleMaxLongitude; double MapCoords::Longitude(float x, float z) // degrees , (x (meters) - to North, z (meters) - to East) { double ang = - atan (((double)(z - centerZ)) / (x - centerX)) * ToDegree; return ang * ToAngleW_E + MiddleLongitude; } double MapCoords::Latitude(float x, float z) // degrees (x (meters) - to North, z (meters) - to East) { double len = lenSouth - sqrt((x-centerX)*(x-centerX) + (z-centerZ)*(z-centerZ)); return len * ToLengthN_S + EndSouth; } void MapCoords::GetCoords(double inLatitudeDegrees, double inLongitudeDegrees, float &outX, float &outZ) { // Lo coordinates system double realAng = (inLongitudeDegrees - MiddleLongitude) / ToAngleW_E / ToDegree; double realLen = lenSouth - (inLatitudeDegrees - EndSouth) / ToLengthN_S; outX = centerX - realLen * cos (realAng); outZ = centerZ + realLen * sin (realAng); } Link to comment Share on other sites More sharing options...
Doug Posted August 16, 2006 Author Share Posted August 16, 2006 Yesssss :) Thank you very much Alex !!! Regards. Doug LOTATC .NET // LOVICA .NET // 3rd Wing Link to comment Share on other sites More sharing options...
Doug Posted August 16, 2006 Author Share Posted August 16, 2006 Here you can found LUA fonctions of Alex's work: --data for recalculation zeroX = 5000000 zeroZ = 6600000 centerX = 11465000 - zeroX --circle center centerZ = 6500000 - zeroZ pnSxW_X = 4468608 - zeroX -- point 40dgN : 24dgE pnSxW_Z = 5730893 - zeroZ pnNxW_X = 5357858 - zeroX -- point 48dgN : 24dgE pnNxW_Z = 5828649 - zeroZ pnSxE_X = 4468608 - zeroX -- point 40dgN : 42dgE pnSxE_Z = 7269106 - zeroZ pnNxE_X = 5357858 - zeroX -- point 48dgN : 42dgE pnNxE_Z = 7171350 - zeroZ lenNorth = math.sqrt((pnNxW_X-centerX)*(pnNxW_X-centerX) + (pnNxW_Z-centerZ)*(pnNxW_Z-centerZ)) lenSouth = math.sqrt((pnSxW_X-centerX)*(pnSxW_X-centerX) + (pnSxW_Z-centerZ)*(pnSxW_Z-centerZ)) lenN_S = lenSouth - lenNorth RealAngleMaxLongitude = math.atan ((pnSxW_Z - centerZ)/(pnSxW_X - centerX)) * 180/pi -- borders EndWest = 24 EndEast = 42 EndNorth = 48 EndSouth = 40 MiddleLongitude = (EndWest + EndEast) / 2 ToLengthN_S = ((EndNorth - EndSouth) / lenN_S) ToAngleW_E = (MiddleLongitude - EndWest) / RealAngleMaxLongitude ToDegree = 360/(2*pi) function getLongitude(x, z) -- degrees , (x (meters) - to North, z (meters) - to East) ang = - math.atan (((z - centerZ)) / (x - centerX)) * ToDegree return ang * ToAngleW_E + MiddleLongitude end function getLatitude(x, z) --degrees (x (meters) - to North, z (meters) - to East) len = lenSouth - math.sqrt((x-centerX)*(x-centerX) + (z-centerZ)*(z-centerZ)) return len * ToLengthN_S + EndSouth end function getXYCoords(inLatitudeDegrees, inLongitudeDegrees) -- args: 2 numbers // Return two value in order: X, Y -- Lo coordinates system realAng = (inLongitudeDegrees - MiddleLongitude) / ToAngleW_E / ToDegree realLen = lenSouth - (inLatitudeDegrees - EndSouth) / ToLengthN_S outX = centerX - realLen * cos (realAng) outZ = centerZ + realLen * sin (realAng) return outX, outY end To get latitude and longitude with X,Z coord, you have to do this: myLat = getLatitude(myXCoord, myZCoord) myLong = getLongitude(myXCoord, myZCoord) To get X,Z coord with Lat/Long you have to do this (not usefull): myXCoord, myZCoord = getXYCoords(myLat, myLong) myLat and myLong are two float like 48.2034 To convert a latitude (°, min, sec): floatDeg = integerDeg + (60*min + sec)/3600 Ex of Krymsk: 44° 57' 45" N --> 44 + (60*57 + 45)/3600 = 44.9625 Regards Doug LOTATC .NET // LOVICA .NET // 3rd Wing Link to comment Share on other sites More sharing options...
dodger42 Posted August 16, 2006 Share Posted August 16, 2006 Wow nice response. Alex I dont suppose you can say whether there will be other changes to LUA in BS? Fingers crossed! :) . . . Lockon Advanced Realism with Touch-Buddy Link to comment Share on other sites More sharing options...
Fufunka Posted August 17, 2006 Share Posted August 17, 2006 Alex & Doug> can we hope that MFDs/FLIR/ABRIS views will be possible to export someday too? Like the MSFS, Falcon, FlighGear sims can do.. Link to comment Share on other sites More sharing options...
Doug Posted August 17, 2006 Author Share Posted August 17, 2006 Actually we can't export all that we need to build a complete MFD. But we can do it without data like radar position etc. I hope it will be possible in BS. LOTATC .NET // LOVICA .NET // 3rd Wing Link to comment Share on other sites More sharing options...
DarkSoul Posted August 17, 2006 Share Posted August 17, 2006 Alex & Doug> can we hope that MFDs/FLIR/ABRIS views will be possible to export someday too? Like the MSFS, Falcon, FlighGear sims can do.. if BS supports MFD/Flir export.. then i will buy somekind 8" Lcd :joystick: Link to comment Share on other sites More sharing options...
Fufunka Posted August 17, 2006 Share Posted August 17, 2006 DarkSoul> Simmeters have already working version of Lockon glasspanel gauges and HUD view export so if they will support MFD/ABRIS/Flir you only add "few dozen" switches, displays and warning lights connected for instance via opencockpits IO cards.. Opencockpits architecture is already supported in Lockon FC, MSFS, IL2, Falcon, and EECH is in alpha now.. http://avia.transas.com/eng/abris.htm Link to comment Share on other sites More sharing options...
Doug Posted October 30, 2006 Author Share Posted October 30, 2006 Alex, I would to use the MAP of lockon to build a GPS. This map is a Lambert map ? What is the X and Z positions? Is it the projection of Lat/long position on the Lambert map of LockOn ? I think it work like that: Regards. LOTATC .NET // LOVICA .NET // 3rd Wing Link to comment Share on other sites More sharing options...
bnepethomas Posted October 30, 2006 Share Posted October 30, 2006 Wow nice response. Alex I dont suppose you can say whether there will be other changes to LUA in BS? Fingers crossed! :) Couple of things I am seriously hanging out for is gear, flap and brake status for the pit. Link to comment Share on other sites More sharing options...
EvilBivol-1 Posted November 2, 2006 Share Posted November 2, 2006 Doug, check your PMs, please. - EB [sIGPIC][/sIGPIC] Nothing is easy. Everything takes much longer. The Parable of Jane's A-10 Forum Rules Link to comment Share on other sites More sharing options...
Recommended Posts