Skip to content

Wind computations seldom give the right direction #287

@MacFlorent

Description

@MacFlorent

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.
Image

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions