// by Fishion  - Version 0.01 - 18.Jan. 2003

// Input:
// First argument is a Vector (basically an Array)

// Output:
// a scalar (a Number)
//  the length of the the input vector
//
// the length of a vecotr is defined as the Square-Root over the Scalar-product with itself

//declare Variables
private["_3dpos","_return","_i","_lifetime","_vel","_rad","_height","_size","_color","_x","_y","_wind_var","_wind_dir_var","_w_vel","_drops","_Step","_angle"];

//fetch variables
_lifetime = _this select 0;
_vel = _this select 1;
_rad = _this select 2;
_height = _this select 3;
_size = _this select 4;
_color = _this select 5;
_x = _this select 6;
_y = _this select 7;
_wind_var = _this select 8;
_wind_dir_var = _this select 9;
_drops = _this select 10;

// init return-variable
_return = 0;

// calculate Step
_step = 360/_drops;
_angle = 0;

_i = 0;
While {_i < _drops}
Do
{
_w_vel = [((_vel select 0) + sin(random _wind_dir_var) *(random _wind_var)),((_vel select 1) + cos(random _wind_dir_var) *(random _wind_var)),(_vel select 2)];
_3dpos = [(_x + sin(_angle)*_rad),(_y + cos(_angle)*_rad),_height];
drop ["cl_basic", "", "Billboard", _lifetime, _lifetime, _3dpos, _w_vel, 0, 0.5, 0.4, 0, _size, _color, [0], 0.1, 0.2, "", "", ""];
_i = _i + 1;
_angle = _angle + _step;
};

_return;