I just did that and noticied I should clarify that that temp as required by this function must be provided in degrees F and not C. Can be modified as follows if temp is provided in Celsius.

/*

* Calculates the dewpoint base off of the temperature and relative humidity

* calculation of Dewpoint as provided on http://andrew.rsmas.miami.edu/bmcnoldy/Humidity.html

*/

float calcDewpoint(float temp, float rh)

{

float tempf = (temp * 1.8) + 32;

//TD: =243.04*(LN(RH/100)+((17.625*T)/(243.04+T)))/(17.625-LN(RH/100)-((17.625*T)/(243.04+T)))

return 243.04*(log(rh/100)+((17.625*tempf)/(243.04+tempf)))/(17.625-log(rh/100)-((17.625*tempf)/(243.04+tempf)));

}