Jump to content
The simFlight Network Forums

How to use Lattitude & Longitude?


Recommended Posts

Hi,

I'm trying to use the Lattidude and the Longitude Fsuipc offset (0560 & 0568).

Both offset are a 64 bit. So in my C++ project, i have created a __int64 variable call FsLattidude and FsLongitude.

I need to convert these value to obtain the Lattidude and Longitude information in N45* 50.70' W73* 46.36' type.

How can i do it?

I tryed to use the expression specified (#*90/(10001750*65536*65536)for Lattidude and (#*360/(65536*65536*65536*65536)) for Longitude) but i'll get an error when i'm doing the compilation of the software.

The error type is the integral constante is too small.

Thank you for the information.

Link to comment
Share on other sites

I tryed to use the expression specified (#*90/(10001750*65536*65536)for Lattidude and (#*360/(65536*65536*65536*65536)) for Longitude) but i'll get an error when i'm doing the compilation of the software.

The error type is the integral constante is too small.

You replace the # with your __int64 value. And use floating point, because obviously 90/(10001750*65536*65536) will be a lot less than 1 and not expressable as an integer.

To make the compiler use floating point simply use numbers in floating point format, like 90.0 , 65536.0 etc. And the variable receiving the result should be floating point ("double") too unless you only want the number of degrees and no fractions.

Pete

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.