MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / heatIndexC

Function heatIndexC

libraries/Temperature/temperature.cpp:125–148  ·  view source on GitHub ↗

0.3.0 => https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml previous https://en.wikipedia.org/wiki/Heat_index TC = temp in Celsius RH = relative humidity in %

Source from the content-addressed store, hash-verified

123// TC = temp in Celsius
124// RH = relative humidity in %
125float heatIndexC(float TC, float RH)
126{
127 if ( (TC < 27) || (RH < 40)) return TC;
128 float TF = Fahrenheit(TC);
129 return Celsius(heatIndex(TF, RH));
130
131/*
132 const float c1 = -8.78469475556;
133 const float c2 = 1.61139411;
134 const float c3 = 2.33854883889;
135 const float c4 = -0.14611605;
136 const float c5 = -0.012308094;
137 const float c6 = -0.0164248277778;
138 const float c7 = 0.002211732;
139 const float c8 = 0.00072546;
140 const float c9 = -0.000003582;
141
142 float A = (( c5 * Celsius) + c2) * Celsius + c1;
143 float B = (((c7 * Celsius) + c4) * Celsius + c3) * humidity;
144 float C = (((c9 * Celsius) + c8) * Celsius + c6) * humidity * humidity;
145
146 return A + B + C;
147*/
148}
149
150
151// https://en.wikipedia.org/wiki/Wind_chill

Callers 1

unittestFunction · 0.85

Calls 3

FahrenheitFunction · 0.85
CelsiusFunction · 0.85
heatIndexFunction · 0.85

Tested by 1

unittestFunction · 0.68