- p0
- pressure at sea level
- p
- atmospheric pressure
Documentation for this section has not yet been entered.
Computes the Altitude in meters from the atmospheric pressure and the pressure at sea level.
Typically the atmospheric pressure is read from a Sensor.TYPE_PRESSURE sensor. The pressure at sea level must be known, usually it can be retrieved from airport databases in the vicinity. If unknown, you can use SensorManager.PressureStandardAtmosphere as an approximation, but absolute altitudes won't be accurate.
To calculate altitude differences, you must calculate the difference between the altitudes at both points. If you don't know the altitude as sea level, you can use SensorManager.PressureStandardAtmosphere instead, which will give good results considering the range of pressure typically involved.