I know how that works, I am a physicist

. Well yeah you would have to do a bit of math, that would be the only fun part for me programming something lol.
I did not know, that the sensors are noisy. I tested just this app with my old phone. Looking at the graph it looked quiet stable and I assume only slow movements. But maybe thats the issue for S/B ratio, did not look into raw data tbh.
Was just an idea, i believe I have seen grapha for things like thst from a dive computer. For that purpose a high precision as in caves would not be nevesssry.
A bit (well thats probably an understatement) more complicated could be an autocorrection by depth and compass sensor as well as return to start point.