It's actually very simple. We divide the floor into grids and record each grid you step onto within a certain time. If you current grid overlaps with the ones we've recorded, that means your walk path forms a circle.