Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wind computations seldom give the right direction #287

Open
MacFlorent opened this issue Jan 29, 2025 · 3 comments
Open

Wind computations seldom give the right direction #287

MacFlorent opened this issue Jan 29, 2025 · 3 comments
Assignees

Comments

@MacFlorent
Copy link
Contributor

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.

@MacFlorent MacFlorent added the bug Something isn't working label Jan 29, 2025
@MacFlorent MacFlorent self-assigned this Jan 29, 2025
@MacFlorent MacFlorent removed the bug Something isn't working label Jan 29, 2025
@davidp57
Copy link
Member

On utilise pas mal de fonctions de weatherMark dans veaf.weatherReport

@MacFlorent
Copy link
Contributor Author

C'est pour ça que j'avais indiqué "not too far". Mais veaf.weatherReport devrait être remplacé par veafWeather.

@davidp57
Copy link
Member

pourquoi pas ; à creuser, on peut rouvrir pour étendre

@davidp57 davidp57 reopened this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants