CBA_fnc_randPosArea

Description

Find a random (uniformly distributed) position within the given area without rejection sampling.

Parameters

_areaThe area to find a position within <MARKER, TRIGGER, LOCATION, ARRAY>
_perimeterTrue to return only positions on the area perimeter (optional, default: false) <BOOLEAN>

Returns

Position ARRAY (Empty array if invalid area was provided)

Examples

 _position = [marker, true] call CBA_fnc_randPosArea;

 _position = [trigger] call CBA_fnc_randPosArea;

_position = [location] call CBA_fnc_randPosArea;

_position = [[center, a, b, angle, isRectangle]] call CBA_fnc_randPosArea;

Author

SilentSpike 2015-07-06

A function used to randomize a position around a given center
Array to read from [Array]
Close