Magnetometer data fitting to elipsoid