##### DA : ft
This calculation is based upon the NOAA method detailed in the following article:

NOAA density altitude calculation

Note that density altitude is most sensitive to errors in temperature, then pressure and finally dew point. That is to say that dew point has a far lesser impact on density altitude than temperature. The ratio of error magnitude - Temperature : Pressure : Dew point is of the order 8.4 : 3.5 : 1

Before calculating density altitude, the virtual temperature Tv must be calculated. The air temperature T must be in Kelvin, the station pressure P available in inches of mercury and hectopascals and the dewpoint in degrees C.

First of all vapour pressure e is calculated: $$e=6.11*10^{\bigg(\frac{7.5 * T_d }{237.7 + T_d}\bigg)}$$ Then station pressure in hectopascals PhPa is used to calculate the virtual temperature Tv in Kelvin : $$T_v=\frac{T}{1-\big(\frac{e}{P_{hPa}}\big)*(1-0.622)}$$ Now we need to convert virtual temperature units from Kelvin to Rankine Tr : $$T_r = \bigg(\frac{9}{5}*(T_v - 273.15)+32\bigg)+459.69$$ Finally density altitude is calculated using station pressure in inches of mercury PinHg : $$h_{density}=145366* \bigg(1-\bigg(\frac{17.326*P_{inHg}}{T_r}\bigg)^{0.235}\bigg)$$