Sign in to follow this  
Guest bartels

Flying between LAT-LON coordinates.

Recommended Posts

Hi,I would like to make an aircraft fly between a LAT-LON position to another LAT-LON position from within an XML gauge.Sort of fly from A to B given the coordinates of A and BThe gauge should then calculate a Heading. Is that possible?Roelof

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Roelof,Yes.The formula's you have to use are a bit dependant on the distance between the two positions.If the distance is short (< 100 nMile), you can use simple formula's.See for examples the Ball.xml (HUD) gauge in my rcbco-20.zip package.Now, over larger distances you shouldnot assume a straight line between two coordinates, because the world isn't flat :-)I.o.w. the shortest way between isn't a straight line, but might be a curve (depending on the coordinates); so with a changing heading during flight.For this you have to use the so-called "great circle navigation" formula's.See e.g.: http://williams.best.vwh.net/avform.htmGroetjes, Rob

Share this post


Link to post
Share on other sites

Thanks Rob,I am aware of the great circle navigation but implementing it in an XML file looks quite a complex adventure. )-:I'll have a look at your Ball.xml as well. An interesting site btw.Maybe OT but I dl Dougs dsd_xml_sound3.gau today.Together with a dsd_xml_sound.ini there are 3 readme files.Get's a little bit confusing. Since your a master in it I would like to ask a few things. 1. Where does dsd_xml_sound3.gau go? Gauges?2. Where does the dsd_xml_sound.ini go? AircraftPanel folder?3. How many ini files can this dsd_xml_sound3.gau handle? I suppose you would have to give them different names.4. At one point Dougs is talking about./config_file.ini ./Gauges/dsd_xml_sound.ini .SoundPiper_sounds.ini Here I get lost. Can you shed some light on this?Much obliged as always,Groetjes Roelof

Share this post


Link to post
Share on other sites

Roelof,The gauge itself should go in the Gauges folder. The .ini file can go pretty much anywhere, you just have to specify where it is. You do this by listing the path as a parameter in the panel.cfg entry for the gauge.By using different names I was hoping to make clear that you are not limited to any particular file name or path.Doug

Share this post


Link to post
Share on other sites

I placed some great circle XML code here some time ago, I think. Can't find it at the moment.

Share this post


Link to post
Share on other sites

>Roelof,>>The gauge itself should go in the Gauges folder. The .ini>file can go pretty much anywhere, you just have to specify>where it is. You do this by listing the path as a parameter>in the panel.cfg entry for the gauge.>By using different names I was hoping to make clear that you>are not limited to any particular file name or path.>>Doug>Now I get it Doug. These 3 ini files represent one and the same right?To put my mind at ease.... All I need is the one and only dsd_xml_sound3.gau and one .ini file.For more aircraft you can use more ini's.Thanks a lot Doug. I can get on with it now!Roelof

Share this post


Link to post
Share on other sites

>I placed some great circle XML code here some time ago, I>think. Can't find it at the moment.That's the best news I had today. :DAnyway, whenever you run in to it, keep me posted.Roelof

Share this post


Link to post
Share on other sites

Thanks Arne and Jan,This wil keep me going for a while.Roelof

Share this post


Link to post
Share on other sites

Here's a suggestion for the gauge...Slave it to the heading bug, so the heading bug is updated (perhaps once every few minutes so there's no impact on speed) as the heading changes from the aircraft's position to the dest. lat/lon. The autopilot could then fly the great circle route.Next, include distance to destination, and groundspeed, and ETA to destination. That would be a rather handy gauge if the interface for entering the lat/lon were easy-John

Share this post


Link to post
Share on other sites

Thanks John,The plan is taking some shape now. Still a long way to go though.Roelof

Share this post


Link to post
Share on other sites

Thanks John, Enough to keep me going. Don't hold your breath though. Jan went as far as calling it a threat! :D >Have a look in this threat and >do a search for "great circle"Wonder what became of his FMC?Are you there Jan?Roelof

Share this post


Link to post
Share on other sites

This discussion is very interesting and brings another question:I use the same great circle formula as Arne. It works fine, but it calculates true heading, and it needs to be converted into magnetic heading. For this reason, I need to have the magnetic variation value. Where can it be found?I know FS provides it through the "MAGNETIC VARIATION" variable, but this is valid at the aircraft position only. If you calculate the headings for a flight plan, you need to have the mag var value anywhere in the world. Any clue?Eric

Share this post


Link to post
Share on other sites

>I know FS provides it through the "MAGNETIC VARIATION">variable, but this is valid at the aircraft position only. If>you calculate the headings for a flight plan, you need to have>the mag var value anywhere in the world. Any clue?>>EricI would not be surpriced if there would be a formula for it.After all. The difference between both is called the varation and is zero when both poles Magnetic and True are in line with each other from your position. Basically the variation changes because of 2 reasons.The first change is caused by the magnetic field that moves. Maps have to be updated every year or so. The second change is caused by moving your position on the globe. The sum total of the two is your variation.Roelof

Share this post


Link to post
Share on other sites

I don't think there is a formula for it. I am a private pilot, and I use VFR maps to fly. If you look at the curve that shows the 2

Share this post


Link to post
Share on other sites

You only have the mag var at the aircraft location, but for following the course you need this variation, not more. The mag var at the waypoint isn't needed for flying.

Share this post


Link to post
Share on other sites

Hello Arne,You're perfectly right: the mag var at the aircraft location is enough to fly the aircraft correctly along the flight plan.The problem is that for my FMC, I may need to calculate and display the heading between waypoint A and waypoint B, even if A and B are very far from my aircraft. This is why I would like to get the mag var at the location of waypoint A, but I'm afraid it's impossible...Eric

Share this post


Link to post
Share on other sites

You could cheat a bit and right a nice "T" (true heading) to the course/heading which is used for user defined Waypoints in FMCs. AFAIK only the predefined waypoints have magnetic headings. In a C gauge you might find the magvar in the flightplan file, but I'm not sure.

Share this post


Link to post
Share on other sites

I was wondering if you got this to work. Also, could a gauge written in C++ do the same thing? I want to have an F16 dive into an unusual attitude when it hits a certain longitude to simulate an auto-evasion of a surface-to-air-missile. Thanks for any help.

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