We are currently changing the Bohemia Interactive forum software. This means http://forums.bistudio.com will be 'Read Only' until Thursday 9 AM UTC. Apologies for the inconvenience.

Results 1 to 4 of 4

  Click here to go to the first Developer post in this thread.  

Thread: Formula to convert "wind"-values into degree (0-359) ?

  1. #1

    Formula to convert "wind"-values into degree (0-359) ?

    Since I'm not an expert in maths, does anyone know a/the formula to convert the wind-values into a number (0-359 degree)?

    Further, is there a possibility to return the wind force in knots and km/h ?


  2. #2
    This should get you the direction in degrees:

    (wind select 0) atan2 (wind select 1)
    Note that wind does have a vertical direction, but I think that is safe to ignore. As for the wind strength:

    sqrt((wind select 0)^2 + (wind select 1)^2)
    This will give you the correct value, but I'm not sure what unit the wind command returns. Meters per second perhaps?

    EDIT: Looks like the atan2 command doesn't return values in the 0...359 range, but rather -180...+180. Easy enough to convert though.
    Last edited by MadDogX; Mar 26 2012 at 18:29.

    Gigabyte Z97-HD3 Motherboard | Intel Core i5 4690k @ 4.5GHz | NVidia GTX 970
    16GB G-Skill Ripjaws 2133MHz RAM | Kingston HyperX SSD | be Quiet! 750W PSU

  3. #3
    Thanks for the formulas. Is there a dev or anyone else who certainly knows the speed the wind command returns?

  4.   This is the last Developer post in this thread.   #4
    Further, is there a possibility to return the wind force in knots and km/h ?
    The wind vector is meters per second if I'm not mistaken. You can convert numbers (note: not vectors) to different units using BIS_fnc_convertUnits. Check the in-game function viewer in the editor on how to use it. This is a scripted function, so performance is slower than true script command.

    PHP Code:
    [3229call BIS_fnc_convertUnits//Convert 32 mps to kts 
    Bohemia Interactive
    Arma 3 - Project Lead
    Watch us, tweet us, poke us

    Take On Helicopters - Project Lead
    Take On Noisecontrollers!

Similar Threads

  1. The Elusive Stopping Power "Formula" and ArmA 3
    By Pvt_Ryan in forum ARMA 3 - GENERAL
    Replies: 115
    Last Post: Nov 12 2013, 12:06
  2. How to have "Random" return values in certain Range
    By SCAJolly in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 11
    Last Post: Jul 12 2011, 14:04
  3. Character animations and "Action" Values.
    By leop in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 2
    Last Post: Jan 27 2006, 02:36
  4. Mapfact.net releases "Leaves in the wind"
    By BadAss [Mapfact.net] in forum USER MISSIONS
    Replies: 27
    Last Post: Mar 17 2005, 18:16
  5. Wind "blowing" in my ears
    By zxc in forum TROUBLESHOOTING
    Replies: 19
    Last Post: Oct 31 2002, 22:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts