This repository contains a platformio library and an explanatory jupyter notebook for calculating the hard and soft iron offsets of an magnetometer as descriped in [Calibrating an eCompass in the Presence of Hard- and Soft-Iron Interference](https://www.nxp.com/docs/en/application-note/AN4246.pdf) by NXP.
This implementation depends on Eigen. For platform.io projects you can use [Eigen_Platformio_Header](https://github.com/hobbeshunter/Eigen_Platformio_Header).