c++ - wind-chill 公式的程序表示是什么?

标签 c++ c weather

我正在尝试确定公制风寒度。我找到了一些 good information from the BBC (它被称为“感觉像温度”),但我不太清楚如何将它转换为 C 代码。

这是他们的计算信息:

T(wc) = 13.12 + 0.6215T - 11.37V**0.16 + 0.3965TV**0.16

有了这些笔记

(Where T(wc) is the wind chill index based on the Celsius scale, T is the air temperature in °C, and V is the air speed in km/h measured at 10 m (33 ft, standard anemometer height).

所以我创建了这个,但我得到的输出有时是负的

float feelslike = 13.12 + 0.6215 * temperature - 11.37 * windSpeed  * 0.16 + 0.3965 * temperature * windSpeed * 0.16;

也许我遗漏了什么?我假设当它有“0.6215T”时,它的意思是“0.6215 * T”,但我也不确定如何解释等式中的双“*”。

示例输出:

feelslike 15.126314 temp 19.719999 wind 18.040001
feelslike 15.126314 temp 19.719999 wind 18.040001
feelslike 14.308528 temp 20.070000 wind 20.670000
feelslike 14.308528 temp 20.070000 wind 20.670000
feelslike 12.485908 temp 20.049999 wind 23.930000
feelslike 12.485908 temp 20.049999 wind 23.930000
feelslike 9.340910 temp 19.450001 wind 27.110001
feelslike 9.340910 temp 19.450001 wind 27.110001
feelslike 5.497787 temp 18.330000 wind 28.969999
feelslike 5.497787 temp 18.330000 wind 28.969999
feelslike 2.776235 temp 16.740000 wind 27.400000
feelslike 2.776235 temp 16.740000 wind 27.400000
feelslike 0.058707 temp 14.950000 wind 25.670000
feelslike 0.058707 temp 14.950000 wind 25.670000
feelslike -1.787689 temp 13.130000 wind 23.389999
feelslike -1.787689 temp 13.130000 wind 23.389999
feelslike -1.408279 temp 12.460000 wind 21.650000
feelslike -1.408279 temp 12.460000 wind 21.650000
feelslike -0.960956 temp 11.810000 wind 20.020000
feelslike -0.960956 temp 11.810000 wind 20.020000
feelslike -1.235470 temp 11.550000 wind 19.820000

最佳答案

T(wc) = 13.12 + 0.6215T - 11.37V**0.16 + 0.3965TV**0.16

意思是:

T(wc) = 13.12 + 0.6215*T - 11.37*pow(V,0.16) + 0.3965*T*pow(V,0.16)

在 C/C++ 中

关于c++ - wind-chill 公式的程序表示是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15977869/

相关文章:

database - 我在哪里可以找到历史原始天气数据?

C++11:参数包扩展计数器

c++ - const 重载的 operator[] 函数及其调用

c - 如何使用 C 中的条件测试从数组中删除某些元素?

c - 哪些可移植性问题与 C 语言中指针的字节级访问相关?

embed - 嵌入天气预报的好资源

python - 计算卫星数据中 u 和 v 风分量的旋度 - Python

c++ - 在 C++ 中搜索和删除字符串中的某些字符

c++ - 将 QWebView 打印为 PDF

c - 如何在 C 语言编程中使用 execvp 或其他类型的 exec 函数执行 cat 命令