I am almost done with building a tool which converts flightplans into custom missions. This is done by grabbing data from the main.mcf and converting it into a new custom_missions.tmc file.
One of the obstacles I did not find an answer to was: How to convert the coordinates for a given waypoint (vector3_float64) in the main.mcf into a WGS84 coordinate for custom_missions.tmc?
As an example find the to waypoint representations attached:
<[string8u][name][CESRA]>
<[vector2_float64][lon_lat][-119.761958333333 34.4294083333333]>
<[float64][altitude][858.899]>
<[float64][direction][88.6024010104634]>
<[string8u][Identifier][CESRA]>
<[vector3_float64][Position][-2614261.54352665 -4571804.72594129 3585834.88797721]>
<[vector2_float64][Altitude][-1001 100001]>
I found some geo conversion formulas in this forum, but obviously they are meant for other cases (or I am using them wrong). So does anybody know how to convert -2614261.54352665 -4571804.72594129 3585834.88797721 into -119.761958333333 34.4294083333333?
How to convert the the vector matrix for the plane orientation (matrix3_float64) in the main.mcf into a regular heading in Degrees for custom_missions.tmc?
As an exmaple find the two represntations of more or less the same state of heading attached:
<[matrix3_float64][orientation][
0.0300546374797615 0.537103816145256 0.842980551049764
-0.909723140763483 0.364114416540669 -0.199560764747666
-0.414126219799454 -0.760881188063847 0.499559097329999
]>
I found some very interesting pages about matrix conversion and had my fun with cosinus, sinus, arctangents and all of their friends, but obviously this matrix is in a format that is not compatible with the (non-Aerofly) instructions I found. So does anybody know how to convert 0.0300546374797615 0.537103816145256 0.842980551049764 -0.909723140763483 0.364114416540669 -0.199560764747666 -0.414126219799454 -0.760881188063847 0.499559097329999 into a simple 346°?