// Heat Index, or Apparent Temperature // calculated when temperature exceeds 80 degrees F, and when the relative humidity is at least 40% // temperature in fahrenheit $t = $array_data['cc'][0]['tmp']; // relative humidity $rh = round($array_data['cc'][0]['hmid']); // if the conditions are correct if (($t > 80) && ($rh >= 40)) { // apparent temperature in fahrenheit $at_far = round(16.93 + (1.85212 * pow(10, -1) * $t) + (5.37941 * $rh) - (1.00254 * pow(10, -1) * $t * $rh) + (9.41695 * pow(10, -3) * pow($t, 2)) + (7.28898 * pow(10, -3) * pow($rh, 2)) + (3.45372 * pow(10, -4) * pow($t, 2) * $rh) - (8.14971 * pow(10, -4) * $t * pow($rh, 2)) + (1.02102 * pow(10, -5) * pow($t, 2) * pow($rh, 2)) - (3.8646 * pow(10, -5) * pow($t, 3)) +(2.91583 * pow(10, -5) * pow($rh, 3)) + (1.42721 * pow(10, -6) * pow($t, 3) * $rh) + (1.97483 * pow(10, -7) * $t * pow($rh, 3)) - (2.18429 * pow(10, -8) * pow($t, 3) * pow($rh, 2)) + (8.43296 * pow(10, -10) * pow($t, 2) * pow($rh, 3)) - (4.81975 * pow(10, -11) * pow($t, 3) * pow($rh, 3))); // apparent temperature in celsius $at_cel = round(((5/9) * ($at_far - 32)), 1); }