TranceAddict Forums

TranceAddict Forums (www.tranceaddict.com/forums)
- Chill Out Room
-- Math help!!!
Pages (2): « 1 [2]


Posted by Joss Weatherby on Sep-30-2009 03:00:

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];


Posted by Zild on Sep-30-2009 03:22:

quote:
Originally posted by Joss Weatherby
Actually lots of math smarties here, have helped me in the past.


he's right i have a maths minor and others here have way more math education than i do


Pages (2): « 1 [2]

Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.