PhoenixRET Posted May 16, 2003 Report Posted May 16, 2003 What is the proper expression for converting the Lat and Long data after you extract it from FSUIPC ? Thanks In Advance
Pete Dowson Posted May 16, 2003 Report Posted May 16, 2003 PhoenixRET said: What is the proper expression for converting the Lat and Long data after you extract it from FSUIPC ? I explain it in words in the SDK programmers guide -- the recently elaborated explanation should surely be clear enough? I don't give expressions as how to do it would be different in each language. Pete
jcboliveira Posted May 16, 2003 Report Posted May 16, 2003 int lat; float latitude,longitude; int longi; DWORD DwResult; FSUIPC_Read(0x564, 4, &lat, &DwResult); FSUIPC_Read(0x56c, 4, &longi, &DwResult); FSUIPC_Process(&DwResult); latitude=(float)((float)lat*90.0/10001750.0); longitude=(float)((float)longi*(360.0/(65536.0*65536.0))); if (longitude >180) longitude=(float)(longitude-360.0); float DegLat,FracDegLat,MinLat,SecLat; FracDegLat=modff(fabs(latitude),&DegLat); SecLat=modff(FracDegLat*60,&MinLat); SecLat*=60; SecLat=floorf (SecLat); float DegLon,FracDegLon,MinLon,SecLon; FracDegLon=modff(fabs(longitude),&DegLon); SecLon=modff(FracDegLon*60,&MinLon); SecLon*=60; SecLon=floorf (SecLon); char *message2,*message1; WORD length; message1=(char*)calloc (400,1); message2=message1; if (latitude>0&&longitude>0) length=sprintf (message2, "AUTOPOS N%2.0fº %2.0f' %2.0f'' E%2.0fº %2.0f' %2.0f'' \n", DegLat, MinLat, SecLat,DegLon, MinLon, SecLon); if (latitude<0&&longitude>0) length=sprintf (message2, "AUTOPOS S%2.0fº %2.0f' %2.0f'' E%2.0fº % 2.0f' %2.0f'' \n", DegLat, MinLat, SecLat,DegLon, MinLon, SecLon); if (latitude<0&&longitude<0) length=sprintf (message2, "AUTOPOS S%2.0fº %2.0f' %2.0f'' W%2.0fº %2.0f' %2.0f'' \n", DegLat, MinLat, SecLat,DegLon, MinLon, SecLon); if (latitude>0&&longitude<0) length=sprintf (message2, "AUTOPOS N%2.0fº %2.0f' %2.0f'' W%2.0fº %2.0f' %2.0f'' \n", DegLat, MinLat, SecLat,DegLon, MinLon, SecLon); José
PhoenixRET Posted May 16, 2003 Author Report Posted May 16, 2003 Thanks Jose, I am writting in Basic.net but I am sure I can convert the code. Thanks Again.... PhoenixRET
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