Advertisement
Faguss

OFP vehicle speed from velocity vectors

Jun 13th, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. _plane = _this select 0
  2. _x = velocity _plane select 0
  3. _y = velocity _plane select 1
  4. _z = velocity _plane select 2
  5. _xy = sqrt (_x^2 + _y^2)
  6. _speed = 3.6 * (if (_xy!=0) then {_xy/cos (atan (_z/_xy))} else {abs _z})
  7. hint Format ["%1 %2", speed _plane, _speed]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement