Fixed a rarely occurring calculation error.

This commit is contained in:
ulteq
2015-04-27 19:28:46 +02:00
parent fa6a2566e3
commit ebbcb8e5e7

View File

@ -461,7 +461,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
if (gridHeight > position[2]) { if (gridHeight > position[2]) {
double angle = atan((gridHeight - position[2]) / 100); double angle = atan((gridHeight - position[2]) / 100);
windAttenuation *= pow(cos(angle), 2); windAttenuation *= pow(abs(cos(angle)), 2);
} }
} }
} }
@ -476,7 +476,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
if (heightAGL > 0 && heightAGL < 20) { if (heightAGL > 0 && heightAGL < 20) {
double roughnessLength = calculateRoughnessLength(windSourceObstacles[0], windSourceObstacles[1]); double roughnessLength = calculateRoughnessLength(windSourceObstacles[0], windSourceObstacles[1]);
windAttenuation *= (log(heightAGL / roughnessLength) / log(20 / roughnessLength)); windAttenuation *= abs(log(heightAGL / roughnessLength) / log(20 / roughnessLength));
} }
} }