javaandroidkotlinsensorsmagnetometer

Android : What exactly is the "magnetic inclination angle" returned by the getRotationMatrix() and getInclination() methods?


What is the meaning of this value? It seems stuck at -50 -70 degrees even if I change the orientation of the phone.

if (SensorManager.getRotationMatrix(rotationMatrix, inclinationMatrix, accelerometerValues, magnetometerValues)) {
    Log.i("LOG", "${SensorManager.getInclination(inclinationMatrix) * 180 / PI}")
}

However, the magnetometer is well calibrated and returns correct readings between -179 and 179 degrees (0 degrees = North).


Solution

  • Magnetic dip, dip angle, or magnetic inclination is the angle made with the horizontal by the Earth's magnetic field lines. This angle varies at different points on the Earth's surface. Positive values of inclination indicate that the magnetic field of the Earth is pointing downward, into the Earth, at the point of measurement, and negative values indicate that it is pointing upward. The dip angle is in principle the angle made by the needle of a vertically held compass, though in practice ordinary compass needles may be weighted against dip or may be unable to move freely in the correct plane. (Source: Wikipedia)