2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-05-15 17:00:11 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Calculates wind chill based on temperature and wind speed
|
|
|
|
*
|
|
|
|
* Arguments:
|
2016-01-05 07:39:29 +00:00
|
|
|
* 0: temperature - degrees celsius <NUMBER>
|
2015-08-04 00:11:24 +00:00
|
|
|
* 1: wind speed - m/s <NUMBER>
|
2015-05-15 17:00:11 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-04 00:11:24 +00:00
|
|
|
* wind chill <NUMBER>
|
2015-05-15 17:00:11 +00:00
|
|
|
*
|
2016-01-05 07:39:29 +00:00
|
|
|
* Example:
|
|
|
|
* [0, 10] call ace_weather_fnc_calculateWindChill
|
|
|
|
*
|
2015-05-15 17:00:11 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-04 00:11:24 +00:00
|
|
|
params ["_t", "_v"];
|
2015-05-15 17:00:11 +00:00
|
|
|
|
|
|
|
// Source: https://en.wikipedia.org/wiki/Wind_chill
|
2015-05-16 10:39:52 +00:00
|
|
|
|
|
|
|
if (_t > 10) exitWith { _t };
|
|
|
|
if (_v < 1.39) exitWith { _t };
|
|
|
|
|
|
|
|
_v = _v * 3,6; // wind speed in km/h
|
|
|
|
(13.12 + 0.6215 * _t - 11.37 * _v ^ 0.16 + 0.3965 * _t * _v ^ 0.16)
|