| Algorithm 1 Make Magnetic Pattern Database. | |
| Input: Location coordinate and magnetic data for three smartphones | |
| Output: Binary Grid (BG)- magnetic pattern database | |
| 1: | fordo |
| 2: | // k represents the no. of subsequent and previous data points taken. |
| 3: | |
| 4: | |
| 5: | end for |
| 6: | |