Jump to content
Sign in to follow this  
Lost_in_Isaan

A question for the Math, XML and FSX Experts.

Recommended Posts

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.

Edited by Lost_in_Isaan

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
...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.
That will require some trickery with SimConnect. You need to create an object that you can place over the point whose elevation you wish to determine.I see that in v1.2 of P3D they have added some cool features that will allow for determinining this information without the use of a dummy object.None of this is going to happen in XML though...Doug

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...