# How Temperature, Pressure and Altitude are related in the atmosphere?

I'm looking for an approximation for the temperature of the atmosphere at any height and pressure.

Both altitude and pressure are known variables,

I've derived this equation using maxwell's distribution:

Is this suitable? It only needs to be accurate to the top of the troposphere

Also, Latitude is another known variable, if I can take this into account that would be great.

Adiabatic expansion of ideal gases is described by $P\sim {{\rho }^{\gamma }}$, where $\gamma \equiv {{C}_{P}}/{{C}_{V}}=7/5$ for dry air. Combining this with the equation of hydrostatic equilibrium, $dP/dz=-g\rho$, and the ideal gas law, $RT=PV=Pm/\rho$, we find a constant lapse rate: $dT/dz=-\tfrac{\gamma -1}{\gamma }mg/R=$ -9.8 deg/km, where m = 29 g/mol. But this value exaggerates the measured average temperature profile.
The International Standard Atmosphere use in aero engineering has $dT/dz=$ -6.5 deg/km, consistent with $\gamma$ = 1.26, from sea level up to 11 km, the empirical value at mid-latitudes.
\begin{align} & T(z)=290K-(6.5\tfrac{\deg }{\text{km}})z \\ & P(z)/P(0)={{[T(z)/T(0)]}^{1.26/0.26}} \\ & \rho (z)/\rho (0)={{[T(z)/T(0)]}^{1.00/0.26}} \\ \end{align}
In most climes, however, the air is not so dry. On a muggy summer day with a dew point of 20°C, the partial pressure of water vapor will be 17.5 out of 760 torr. That’s 2.30% by molar content or 1.43% by weight. When a buoyant blob of air ascends, it will initially cool off at 9.8 deg/km, but when its temperature reaches the dew point, the water vapor will begin to condense, usually onto particulate nuclei. (Caveat: Very clean air can become supersaturated. Surface tension acts as an obstacle to the formation of fog droplets from scratch.) At this temperature, water releases about 585 cal/g as it condenses. Given the slope of its vapor pressure curve, about 1.1 torr/deg at 20°C, condensation will roughly triple the heat capacity of saturated air, reducing $\gamma$ and the lapse rate until the air has dried out. The effect is even greater in tropical climes, where the altitude of the tropopause can be as high as 17.5 km.