#!/usr/bin/perl (! scalar @ARGV) && die "usage: $0 tempC %RH\n"; # Tc = temp C RH = %RH my ($Tc,$RH,$foo) = @ARGV; my $Es = 6.11*10.0**(7.5*$Tc/(237.7+$Tc)); # The next step is to use the saturation vapor pressure and the relative # humidity to compute the actual vapor pressure(E) of the air. This can be done # with the following formula. my $E=($RH*$Es)/100; # RH=relative humidity of air expressed as a percent.(i.e. 80%) #Now you are ready to use the following formula to obtain the dewpoint #temperature. #Tdc = temp dew C my $Tdc = (-430.22+237.7*log($E))/(-log($E)+19.08); print "Temp $Tc RH $RH is dewpoint of $Tdc\n";