Ref.1: the Freescale Semiconductor Application Note. Number AN4399, Rev.2.0 10/20/2015 High-Precision Calibration of a Three-Axis Accelerometer by Mark Pedley.
Ref.2: ST Design Tip DT0059. Ellipsoid or sphere fitting for sensor calibration by Andrea Vitali.
Ref.3: Freescale Semiconductor Application Note. Document Number: AN4246 Rev. 4.0, 11/2015. Calibrating an eCompass in the Presence of Hard-and Soft-Iron Interference by Talat Ozyagcilar.
Ref.4 The matrix function library are based on the work of Charlie Matlack from 12/18/10, and modified from code by RobH45345 on Arduino Forums, algorithm from NUMERICAL RECIPES: The Art of Scientific Computing.
Ref.5: Jacobi Eigenvalue Algorithm: Iterative methods for eigenvalue problem by Roy Radharaman and Chattopadhyay Mouktik. Project Report 15-11-2013. https://www.cmi.ac.in/~ksutar/NLA2013/iterativemethods.pdf
Ref.6: Gauss Elimination Method using C. https://www.codesansar.com/ numerical-methods/gauss-elimination-method-using-c-programming.htm
Ref.7: Freescale Semiconductor Application Note. Document Number: AN4248 Rev. 4.0, 11/2015. Implementing a Tilt-Compensated eCompass using Accelerometer and Magnetometer Sensors by Talat Ozyagcilar.
Ref.8: Freescale Semiconductor Application Note. Document Number: AN3461 Rev. 6, 03/2013. Tilt Sensing Using a Three-Axis Accelerometer by Mark Pedley.
Ref.9: Autonomy in Motion. Measuring Quadcopter Attitude with Sensors. A blog on autonomy and dynamics which tends to diverge on tangents, by Charles Tytler.