modulepackage
0.0.0-20240125034355-dcc4857f9113
Repository: https://github.com/ka1hung/thc.git
Documentation: pkg.go.dev
# README
thc: Temperature Humidity Calculator
Temperature Humidity Calculator
Quickly start
install
go get -u github.com/ka1hung/thc
example
package main
import (
"fmt"
"github.com/ka1hung/thc"
)
func main() {
fmt.Printf("°F to °C: %v °C\n", thc.FtoC(100))
//°F to °C: 37.78 °C
fmt.Printf("°C to °F: %v °F\n", thc.CtoF(30))
//°C to °F: 86 °F
fmt.Printf("DewPoint: %v °C\n", thc.DewPoint(35, 85))
//DewPoint: 32.1 °C
fmt.Printf("WetBulb: %v(°C)\n", thc.WetBulb(35, 85))
//WetBulb: 35.37(°C)
fmt.Printf("Absolute Humidity: %v(g/kg(a))\n", thc.AH(35, 85))
//Absolute Humidity: 30.79(g/kg(a))
fmt.Printf("Enthalpy(kj/kg): %v(kJ/kg)\n", thc.Enth(35, 85))
//Enthalpy: 114.13(kJ/kg)
fmt.Printf("Enthalpy(btu/lb): %v(btu/lb)\n", thc.EnthBTU(35, 85))
//Enthalpy: 56.75(btu/lb)
thi, msg := thc.THI(35, 85)
fmt.Printf("THI: %v(%s)", thi, msg)
//THI: 33(Muggy)
}
Hope you like it.
# Functions
Absolute Humidity calculate in: t = Temperature(°C); h = Relative Humidity(%); out: AH (KG_Water/KG_DryAir).
CtoF convert °C to °F.
Dew Point Temperature calculate in: t = Temperature(°C); h = Relative Humidity(%); out: DewPoint(°C).
Enthalpy calculate in: t = Temperature(°C); h = Relative Humidity(%); out: Enth(kJ/kg).
Enthalpy calculate in BTU type in: t = Temperature(°C); h = Relative Humidity(%); out: Enth(Btu/lb).
FtoC convert °F to °C.
Temperature Humidity Index calculate (Comfortable Index) in: t = Temperature(°C); h = Relative Humidity(%); out: index, msg
THI<=10 -> very cold
11<=THI<=15 -> cold 16<=THI<=19 -> Slightly cold 20<=THI<=26 -> comfortable 27<=THI<=30 -> muggy 31<=THI -> danger.
Wet Bulb Temperature calculate in: t = Temperature(°C); h = Relative Humidity(%); out: WetBulb(°C).
# Variables
setting for DecimalPlaces of each calculate result, deflaut is 2.