c++ - Best way to store coords: struct of uints or double? -
i have geo coordinates in format n000.11.22.333 e444.55.66.777. milliseconds necessary precision. need perform calculations calculate coord given coord0, angle , distance. sure want keep precision not less milliseconds. , other calculation algorithms use trigonometric functions result. solution better: 1) use struct contains degrees, minutes, seconds , milliseconds uints , overload operators manipulate them; 2) use double type , convert coords decimal view calculations. think float type not enough stable on these calculations.
be used qt 5.9 x64 project, msvc 2017, win platform only
pick whichever easiest (almost double). double more accurate ruler or careful surveyor. lots of navigation software uses single 32-bit integer lat , 1 long.
wiki
Comments
Post a Comment