TranceAddict Forums (www.tranceaddict.com/forums)
- Chill Out Room
-- Math help!!!
Pages (2): « 1 [2]
Alright you guys wanted some code:
I have it looking like its calculating the average right, now I just need to rotate it properly.
code:
_samples = [355, 358, 0, 5, 351]; //_samples = [180, 180, 180, 180]; _sumX = 0; _sumY = 0; for [{_i=0;},{_i < 4},{_i=_i+1}] do { _sumY = _sumY + (sin (rad (_samples select _i))); _sumX = _sumX + (cos (rad (_samples select _i))); }; player sideChat format["_sumY: %1,_sumX: %2", _sumY, _sumX]; _div = _sumY/_sumX; _az = ((deg (atan _div)) mod 360); player sideChat format["avg: %1", _az];
quote: |
Originally posted by Joss Weatherby Actually lots of math smarties here, have helped me in the past. ![]() |
Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.