Edited by Lost_in_Isaan, 09 January 2012 - 08:18 AM.
![]() Where Flight Simulation Enthusiasts Gather from Around the World! |

Simulation's Premier Resource!
AVSIM is a free service to the flight and simulation communities. Please help us keep it that way. Donate what you can today! Thank you for your support! |
![]() |
IMPORTANT: In order to use the new library, which we will bring online no later than the end of May, you will need to be a registered user of AVSIM. Please register on AVSIM today. Your existing library registration will NOT WORK when the new library comes online! There are currently 956 of your fellow community members in the forums and elsewhere on AVSIM! |
A question for the Math, XML and FSX Experts.
Started by Lost_in_Isaan, Jan 09 2012 08:12 AM
2 replies to this topic
#1
Posted 09 January 2012 - 08:12 AM
It’s the olde flogging horse: Feed forward or Derivative information to make an Auto Terrain Follower work getting accurate forward TRACK co-ordinates and Altitude info. Was inspired to resurrect it after buying the DBS Profiler package, they seem to have the problems sorted. Been working on it for years (on and off) and getting very close but have a problem with the way FSX presents the true value of the TAN of the degrees (Radians) of Latitude.The last equation I need to solve is simple:The TAN of the Latitude squared minus 1 ---- in XML looks like this (simplified):(L: TAN_TF_LAT, number) (L: TAN_TF_LAT, number) * 1 + (>L:Factor_Nm_MUL, number)and that gets shoved into the end calculation. BUT, for example the trig tables for the TAN of the angle (latitude) of 30 degrees is 0.57735 which on paper works perfectly for my solution ----- but this XML command:(A:GPS POSITION LAT, radians) tan (>L:TAN_TF_LAT, number) returns a value of 0.52347 the discrepancy is creating all sorts of hassles.The nearest ‘Bandaid Solution’ I have found looks like this but it’s bullshlt and after 79 Degrees North or South forget it:“Near to real” TAN = 0.94 / cos latitude * tan latitudeOK, where are the numbers men/woman?Thanks.
Regards
Bruce
GA-965P-DS3 Rev3.3 Bios F14d + E8600 Clocked at 4GHZ + 2x2Gb Corsair 8500 + Gigabyte GTX260-OC
Xp Prof SP3
Bruce
GA-965P-DS3 Rev3.3 Bios F14d + E8600 Clocked at 4GHZ + 2x2Gb Corsair 8500 + Gigabyte GTX260-OC
Xp Prof SP3
Please donate today!
|
#2
Posted 01 February 2012 - 01:18 AM
OK, couldn't get much help so with trial and error I managed to get these formulas working perfectly in XML to give me accurate track co ordinates at any distance in front of my plane.Solving the problem above was down to basics, I just simply used this in lieu of the incorrect TAN value.tan = sin(lat1) / cos(lat1)I was then able to solve these.R = sqrt((((a^2*cos lat)^2) + ((b^2*sin lat)^2))) / ((a*cos lat^2) + (b* sin lat^2))lat2 = asin(sin(lat1)*cos(d/R) + cos(lat1)*sin(d/R)*cos(track))lon2 = lon1 + atan2(sin(track)*sin(d/R)*cos(lat1), cos(d/R)-sin(lat1)*sin(lat2))Now if only I can have FSX return the terrain altitude at any given navigation co ordinate as it does with the (A:RADIO HEIGHT, feet) variable beneath the plane I'll be almost there.Any ideas or even hints from the experts will be appreciated.
Regards
Bruce
GA-965P-DS3 Rev3.3 Bios F14d + E8600 Clocked at 4GHZ + 2x2Gb Corsair 8500 + Gigabyte GTX260-OC
Xp Prof SP3
Bruce
GA-965P-DS3 Rev3.3 Bios F14d + E8600 Clocked at 4GHZ + 2x2Gb Corsair 8500 + Gigabyte GTX260-OC
Xp Prof SP3
#3
Posted 01 February 2012 - 09:34 AM
Lost_in_Isaan, on 01 February 2012 - 01:18 AM, said:
...Now if only I can have FSX return the terrain altitude at any given navigation co ordinate as it does with the (A:RADIO HEIGHT, feet) variable beneath the plane I'll be almost there.Any ideas or even hints from the experts will be appreciated.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
















