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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.