February 23, 20251 yr Sorry for this curious question. I'm trying to use SPAD to compute the total distance flown and I know Little Navmap already does it so I wonder if it uses Simconnect variables, then I would be able to replicate that with SPAD. Thanks! Lu.
February 23, 20251 yr Distance flown is calculated from the flown aircraft trail segments since takeoff. It is summarized while flying and independent of flight plan and loaded aircraft performance file. Alex Alex' Projects: Little Navmap
February 24, 20251 yr Author 4 hours ago, albar965 said: Distance flown is calculated from the flown aircraft trail segments since takeoff. It is summarized while flying and independent of flight plan and loaded aircraft performance file. Alex Thanks Alex, May I ask how you get the aircraft position via Simconnect? (I guess). And if you update the trails every time these vars are being updated? My guess is to take the LAT and LON from Simconnect and compute the geodesic distance every time those change but I'm getting different results than LittleNavMap so I wonder what I'm doing wrong.
February 24, 20251 yr 9 hours ago, lrargerich said: Thanks Alex, May I ask how you get the aircraft position via Simconnect? (I guess). Fetching the SimVars "Plane Latitude" and "Plane Longitude". This fetch time can be set in the connection dialog. 9 hours ago, lrargerich said: And if you update the trails every time these vars are being updated? This depends. The trail is kept as lean as possible to avoid performance problems when painting. The distance calculation is independent of this but not calculated with every update. Only every 75 to 550 ms. This depends on the update rate set in options on page "Simulator Aircraft". 9 hours ago, lrargerich said: My guess is to take the LAT and LON from Simconnect and compute the geodesic distance every time those change but I'm getting different results than LittleNavMap so I wonder what I'm doing wrong. The distance is the Great Circle distance between points. This is probably too accurate for such short point distances but it does not hurt. Alex Alex' Projects: Little Navmap
February 24, 20251 yr Author Thanks for the details. May I wonder which distance formula is being used? The one I have is: (Acos((Sin((([PROFILE:A_GPS_PREV_LAT] * 3.1415926535 / 180))) * Sin((([SIMCONNECT:GPS POSITION LAT] * 3.1415926535 / 180)))) + (Cos((([PROFILE:A_GPS_PREV_LAT] * 3.1415926535 / 180))) * Cos((([SIMCONNECT:GPS POSITION LAT] * 3.1415926535 / 180)))) * (Cos((([SIMCONNECT:GPS POSITION LON] * 3.1415926535 / 180)) - (([PROFILE:A_GPS_PREV_LON] * 3.1415926535 / 180))))) * 6378) But this one is giving me a flown distance greater than LittleNavMap, I know there are other Great circle distances but not sure which one is the one you used.
February 24, 20251 yr 1 hour ago, lrargerich said: But this one is giving me a flown distance greater than LittleNavMap, I know there are other Great circle distances but not sure which one is the one you used. Derived from this one: https://www.edwilliams.org/avform147.htm#Dist This is BTW a great collection for all formulae around aviation. I used this a lot. Implementation is here: https://github.com/albar965/atools/blob/8249e5a00c6e36397605e9dd6c27c0039dd95d04/src/geo/pos.cpp#L724-L729 Alex Alex' Projects: Little Navmap
Create an account or sign in to comment