An indoor positioning system using geomagnetic field data