Altitude in an aircraft is generally measured by the hydrostatic
equation: p=rho*g*h, where p is the pressure at the point of
measurement, rho is the density at the point of measurement, g is
the acceleration due to gravity at the point and h is the height
from a reference to that point (the reference is generally taken as
sea level).
Aircrafts use the hydrostatic equation to determine the height/
altitude because pressure can be easily measured with a pitot tube
that planes have. So using a pitot tube the airplanes measure the
pressure and with that they can put it into the equation and solve
for the height.
However, gravity is not the same at different altitudes and
changes with respect to the altitude. It is very difficult for an
airplane to measure gravity in the air. Therefore airplanes
generally measure geopotential altitude. The geopotential altitude
uses gravity at sea level and takes it to be constant. Whereas
geometric altitude uses gravity at the point of measurement.
Therefore P = rho*g0*h(geopotential)
where g0 is the gravity at sea-level and h(geopotential) is the
geopotential altitude
and
P=rho*g*h(geometric)
where g is the gravity at the point of measurement and
h(geometric) is the geometric altitude or the actual height above
sea-level
Notice that the pressure and rho are common in both
equations
-by floyd617