ark1320 Posted February 5, 2017 Report Share Posted February 5, 2017 Hi Pete, I'm trying to figure out how to format/convert latitude and longitude values (both of which I have in degrees) so I can use a Lua script to write these values to offsets 0x560 and 0x0568. I don't understand what the appropriate units are for writing to these offsets, and what the appropriate ipc.write command to use would be. The goal here is to move an aircraft to a lat-long location. I would appreciate any suggestions. Thx, Al Link to comment Share on other sites More sharing options...
ark1320 Posted February 5, 2017 Author Report Share Posted February 5, 2017 Pete, I think I figured it out. I need to 'reverse' the calculations you show for converting offset 0x0560 and 0x568 to degrees in order to get back to the flight sim format (whatever that is) for latitude and longitude, and then use the ipc.writeDD() command to write these values back to offsets 0x0560 and 0x0568. Al Link to comment Share on other sites More sharing options...
Pete Dowson Posted February 5, 2017 Report Share Posted February 5, 2017 1 hour ago, ark1320 said: I think I figured it out. I need to 'reverse' the calculations you show for converting offset 0x0560 and 0x568 to degrees in order to get back to the flight sim format (whatever that is) for latitude and longitude, and then use the ipc.writeDD() command to write these values back to offsets 0x0560 and 0x0568. Yes. The details shown in the offsets list show the way to convert the other way, for READING the Lat/Lon, which is the more usual application. All of the unit conversions sohwn in the whole documwent are that way around. The strange units were designed (way back in SubLogic days I think, presumably when floating point was slow or maybe not even universal), to accommodate the most precision in a fixed point integer. Pete Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now