As pointed by Skynight on the VEAF Discord: https://discord.com/channels/471061487662792715/1333160268829823078
The weathermark method used by the veafWeather module doesn't work properly when computing wind direction. It calculates the wind azimuth based on the vector (x, z) given by DCS by doing math.atan(z, x). It's the right principle, but unfortunately, DCS apparently uses Lua version 5.1, and in this version, math.atan takes only one parameter (it should have been math.atan(z/x)). As a result, the angle is often wrong, more or less.
In Lua 5.3 or higher it would have been okay, but here we need to either pass the correct parameter or use the atan2 function.

Remediation will be to rewrite the wind calculation function.
In addition it's the only thing still being used in weathermark, so we would not be to far from dumping the library altogether.
As pointed by Skynight on the VEAF Discord: https://discord.com/channels/471061487662792715/1333160268829823078
The weathermark method used by the veafWeather module doesn't work properly when computing wind direction. It calculates the wind azimuth based on the vector

(x, z)given by DCS by doingmath.atan(z, x). It's the right principle, but unfortunately, DCS apparently uses Lua version 5.1, and in this version,math.atantakes only one parameter (it should have beenmath.atan(z/x)). As a result, the angle is often wrong, more or less.In Lua 5.3 or higher it would have been okay, but here we need to either pass the correct parameter or use the
atan2function.Remediation will be to rewrite the wind calculation function.
In addition it's the only thing still being used in
weathermark, so we would not be to far from dumping the library altogether.