BuddyTracker / BuddyTrackerThePod

0 stars 1 forks source link

Lat/Lng Representation #4

Closed fdrury closed 6 years ago

fdrury commented 6 years ago

Don’t need to send MSBs of lat/lng Determine maximum range and then calculate how much precision is required for lat/lng.

fdrury commented 6 years ago

Using (integer) millionths of lat/lng Circumference of Earth: 40,075,000 m Latitude: ±90 (180 degrees total) Longitude: ±180 (360 degrees total) Lat/lng:

Degree 1 1/10 1/100 1/1000 1/10,000 1/100,000 1/1,000,000
Distance (m) 111319 11132 1113 111 11 1 0.1

Can probably safely send just up to 100ths of degrees. Using 16 bits for longitude gives values up to 0.065536 degrees Max range of 7,295 m Using 15 bits (call it 16) for latitude gives values up to 0.032768 degrees Max range of 7,295 m