April 18, 200323 yr Arne,Now it becomes a little bit confusing.Say distance from KATL to KLAS is 2000 NMThe heading should be approximately 270 degrees, but is changing constantly because of the great circle(?).How can i put that in an xml value?What is anyway the relation between a waypoint and distance to go concerning the heading to that waypoint?Can you give an example (in xml??)JanNotso"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 18, 200323 yr My honest opinion? In XML is great circle navigation maybe a bit too far, though possible. For shorter distances (up to several hundred nm) you don't need great circle navigation and can work with "plain" trigonometry (not exactly the same as loxodromes, but if you want to implement loxodromes, you can also use great circles, it is as complicated).The distance along longitudes is dy=deltalon*60 (lat lon in degrees, distances in nm), the distance along latitudes is dx=deltalat*60/cos(latitude). Direct distance is then sqrt(dx*dx+dy*dy), the bearing is atan(dy/dx) (use atan2 here).One of the main error in calculations like this, is the confusuiion between angles in degrees and radians, so be aware of it!Arne Bartels
April 18, 200323 yr Very kind of you Arne, but this requires a lot off study in my high school mathematics books and i don't have them anymore.....%((A:Forgotten,hic..))!!!.f %((A:Lost Anatomical Mathematics HUMP,bool)) 1== ((P: abs no time,days)) && && etc.Though i shall try to implement your suggestions to calculate a floating heading to my desired point of destination.Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 18, 200323 yr An example:Waypoint 1 =E004,...; N52,...Waypoint 2 =W084,...; N33,...Distance LON=84+4=88*60=5280 NMDistance LAT=52-33=19*60=1140 NM?? COSLAT=COS19=0,9987 ??Distance LAT=1140/0,9987=1153Real Distance between 1 and 2=(Pythagoras)5280*5280+1153*1153=30470400+1329409=31799809SQRT=5639,13 NMBearing=atan2 1153/5280=1,355800146In degrees: 77,68162621Considering flying from E to W i think i have to add 180, so the end of the calculation =257,6 degreesFSNAV gives 257 degrees.So i think that looks ok, but of course starting in 1 and heading 257 never brings me to 2.I must add a lot of shorter legs.But how to set above formulas in XML?Will try and let you know.Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 18, 200323 yr coslat is the cosine of the average latitude. For small distances you can use either the one from the startpoint or from the endpoint. As a said before it is only valid for small distances, more than 5000nm is much too far. The assumption for the formula is, that the earth is flat, which might be locally acceptable, but not too far out.Last point you need the signs for dx,dy for the correct course. Assuming a flight from Waypoint 1 to Waypoint 2 it would be: Distance LON=84-(-4)=88deg, Distance LAT=33-52=-19deg COSLAT=cos((52+33)/2) and so on.Arne Bartels
April 19, 200323 yr Small Question Arne, I think arteriosclerosis cerebri is hitting so i could be very wrong but,Distance Lon =84-(-4)=88*60=5280 NMMeasured over say (33+52)/2=42.5 LATIsn't that 5280*sin(42.5)=3567,12 NMSo real distance between 1 and 2 becomes SQRT (12724318,67+1299600,00)=3744,85 NMWhich gives an atan2 of 1,26 = 72,28 degrees so steer 252,28The other calculation gives Dist Lon=5280 NMcos(42,5)=0,74so coslat=(33-52)*60=-1140/0,74=-1546,23 NMReal distance is the SQRT etc.=5502 NMWhich gives an atan2 1,86 = 106,32 degrees so steer 286,32Don't know anymoreLast one looks more realistic in vieuw of reality. Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 19, 200323 yr Oops. First the distance along the longitudes is of course the difference in latitudes (longitude constant). And distance along latitudes is difference in longitudes*cos(latitude) (latitudes constant). Second the distance along a latitude is dlon*cos(lat) not dlon/cos(lat) sorry. You divide to get from distances to lon diffs. From lon diffs to distance you multiplicate (the lengths of latitude circles are 360*60*cos(lat), shorter to the poles). From Point1 N52E040 to N33W84:dx=((-84)-4)*60*cos((52+33)/2)=-3893nmdy=(33-52)*60=-1140nmdist=4056crs=(atan2(dx,dy)+360)%360=(-106.3+360)%360=253.7 atan alone would give 73.7, but since you have two cancelling minus in the arguments you have to map it in the third quadrant (+180). atan2 is easier for this, it takes control of the quadrants itself, you might need to modulo the angle to positive values with ..+360)%360.. though.Again over so large distances the calculation is pretty wrong compared to great circle routines. Apart from that, great circle need just a bit more cos/sin stuff.Arne Bartls
April 19, 200323 yr Arne,To bring things a step further: 1. Do i need diff. and integral calcs for the great circle?2. Taking the Plane's position at a certain moment, Lat Lon (Time), it seems possible to calculate distance and angle to a fixed waypoint.Then i could bring the results (the constant changing angle, heading, dependant of plane's pos) in the autopilot and use the distances for other calcs like flightlevel, speed etc.To construct this in XML is another matter, but i 'll try.Good Eastern! (if this is the last post, which i doubt)Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 20, 200323 yr Hallo all, Good Eastern!Again a summary of my idea:1. To make an xml-fmc.2. To let the plane, dependant of weight, weather, distance etc. fly the whole route automatically. 3. To set the heading in the autopilot by calculating course to a waypoint using the plane Jan "Beatus ille qui procul negotiis..."
April 21, 200323 yr Good morningThis one seems the real problem, can't find the proper synthax, but it will set the heading to the waypoint: ((waypoint LATITUDE,number) (A: PLANE LATITUDE, number) -)(((waypoint LONGITUDE,number) (A: PLANE LONGITUDE, number) -) (((waypoint LATITUDE,number) (A: PLANE LATITUDE, number) + ) acos) * ) degrees atan2(>K:HEADING_BUG_SET)Questions:1. How to write the WAYPOINTS coordinates, numbers in XML?2. How to write the proper synthax?3. At all possible??I know it is a lot....Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 21, 200323 yr 1. no, just a sine or cosine extra.Arne BartelsP.S. I was not at home overthe weekend
April 21, 200323 yr Well Arne,Hope you had a nice Estern weekend like me, beatifull weather, lot of planes in the air heading to EEL.I came one step further:%(5064 (A: PLANE LONGITUDE, degrees) 60 * +)%!02.0f%(2018 (A: PLANE LATITUDE, degrees) 60 * -)%!02.0f5024 and 2018 are the LONG- and LAT coordinates of a waypoint * 60 NMSo the code gives me Long and Lat distances, constantly changing of course. I tryed:%(5064 (A: PLANE LONGITUDE, degrees) 60 * + 2018 (A: PLANE LATITUDE, degrees) 60 * - atg2) %!02.0fBut i don't trust the values.Well from tomorrow 4 days holidays elsewhere, no computers etc.Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 21, 200323 yr Affirmative, I fly (ppl) from EHGG.So why bothering about a simulator he ???This one gives a value in degrees, but i have to add 90 to get the right one (FSNAV 3.0)%(5064 (A: PLANE LONGITUDE,degrees) 60 * + 2018 (A: PLANE LATITUDE,degrees) 60 * - atg2 rddg 90 +)%!03.0f!One step for a man....How does it look?Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
April 21, 200323 yr Good about the rddg.I found this meanwhile:%( 8.0 (A:PLANE LONGITUDE, degrees) - (A:PLANE LATITUDE, degrees) dgrd cos * s0 53.2 (A:PLANE LATITUDE, degrees) - s1 atg2 rddg 360 + 360 % (A:MAGVAR,degrees) - near d (>K:HEADING_BUG_SET) )%!d!
Create an account or sign in to comment