TresCopter

Recent site activity

Home‎ > ‎Concepts‎ > ‎

Required Precision for GPS Calculations

Written and Copyright by Todd Berk, 5/14/2009

Introduction

    This article is an investigation into whether single or double precision floating point numbers are required to accurately represent a position on Earth. The driving factor is that in embedded systems without floating point hardware units (most of them, i.e. PIC, AVR, ARM7...) calculations involving floating point numbers are very demanding, and the number of cycles required to compute increases exponentially between single precision (32-bit float) and double precision (64-bit double) floating point numbers. Trigonometry float point functions can take thousands (on 32-bit) to tens of thousands (on many 8-bit) of instructions to compute.

Meters per degree of latitude and longitude at various latitudes

The length between longitude and latitude lines changes with position on the earth, being greatest at the equator, and least near the poles. Here is a table of meters per degree of latitude, and meters per degree of longitude at various degrees of latitude:

 Degrees Latitude
Meters per Degree Latitude  Meters per Degree Longitude
 85 111685   9735
 60 111412   55800
 30  110852  96486
 0  110574  111319

Table 1: table of meters per degree of latitude, and meters per degree of longitude at various degrees of latitude

    Distance between latitude lines varies slightly, while distance between longitude varies heavily. From table 1, it is evident that the maximum distance between longitude lines is about the same length as distance between latitude lines at the equator (zero degrees latitude).

Precision of Float and Double

    As with the distance between longitude and latitude, floating point numbers have various precision depending on the magnitude of the number being stored. Floating point numbers have higher precision when storing smaller numbers, which is an inverse relationship to the distance per degree magnitude (meters per degree longitude is smaller when latitude is greater). This relationship will work to our advantage with longitude, but distance between latitude does not really change with degrees latitude, so  the latitude accuracy will be our limiting factor.

The precision of a floating point number is called the Machine epsilon. For a single precision number (24 bits mantissa) the machine precision is: epsilon = 2-23

The following tables were calculated using the machine precision calculation:

Worst Case Scenarios

Longitude can vary from 0 to 180 degrees, and will have the least precision when at the equator and 180 degrees.

 Degree Latitude Degrees Longitude Single Precision Float accuracy Single Precision Float accuracy in meters (worst case)
 0 (equator) 179.9999 (middle of pacific ocean) .000021 ~2.37 meters
 0 (equator) 160.0  (Cook Pacific Islands) .00002 ~2.11 meters
 0 (equator) 125.0 (not near anything) .000015 ~1.64 meters

Table 2: Single Precision float accuracy worst case scenario (Global)


The following table represents the works case scenarios for the entire United States Territories:

  Degree Latitude Degree longitudeSingle Precision latitude Float accuracy in meters (worst case) Single Precision longitude Float accuracy in meters (worst case) 
 Southwest point Hawaii 20155 0.2641.932
 Northwest point Alaska 701550.930 0.706
 Northeast point Maine 50 700.659 0.598
 Southeast point 25 800 .330 0.962

Table 3: United States total worst case scenario


Some other places of interest

  Degree Latitude Degree longitudeSingle Precision latitude Float accuracy in meters (worst case) Single Precision longitude Float accuracy in meters (worst case) 
 San Francisco, CA 37122.4891.295


Conclusion

It is shown that within the United States (all territories), the wost case latitude error is less than one meter, and the worst case longitude error is less than two meters. These errors are less than the standard GPS accuracy, as well as accuracy when using differential positioning.

References

1) IEEE-754 Floating-Point Conversion From Decimal Floating-Pointhttp://babbage.cs.qc.edu/IEEE-754/Decimal.html

2) Length Of A Degree Of LatitudeAnd Longitude Calculator: http://www.fas.org/news/reference/calc/degree.html