{"name":"BIS_fnc_relPos","operator":null,"title":"BIS fnc relPos","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_relPos","revid":327958,"updated":"2022-07-13T13:07:01Z","groups":["Positions","Geometry"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns a position that is a specified distance and compass direction from the passed position or object.\n\n> [!NOTE]\n> **Arma 3:** In Arma 3 use getPos' alternative syntax instead.","syntaxes":[{"syntax":"[origin, distance, direction] call BIS_fnc_relPos","since":null,"effect":null,"exec":null,"params":[{"name":"origin","type":"Object or Position","optional":false,"default":null,"description":"object or position which should be used as initial point.","types":["Object","Position"],"since":null,"text":"origin: Object or Position - object or position which should be used as initial point."},{"name":"distance","type":"Number","optional":false,"default":null,"description":"distance from initial point","types":["Number"],"since":null,"text":"distance: Number - distance from initial point"},{"name":"direction","type":"Number","optional":false,"default":null,"description":"direction from the intial position","types":["Number"],"since":null,"text":"direction: Number - direction from the intial position"}],"returns":{"type":"Position","types":["Position"],"description":null,"text":"Position"}}],"examples":[{"text":"```sqf\n[[0,0,0], 1000, 50] call BIS_fnc_relPos; // [766.044,642.788,0]\n```","code":["[[0,0,0], 1000, 50] call BIS_fnc_relPos; // [766.044,642.788,0]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["getPos"],"notes":[{"user":"Lawman Actual","date":"2016-01-07T19:26:00Z","text":"The function appears to work in two dimensions, and as such can be used to find the position of a target relative to the player if bearing and distance are known.\n\nHowever, if there is a significant change in elevation between yourself and the target, the distance registered on a rangefinder (which is measuring in a 3-dimensional straight line) will always be larger than the two-dimensional value required for BIS_fnc_relPos and as such air-strikes and ordnance called in using such a function can miss by several hundred metres in extreme cases.\n\nCurrently searching for a method which incorporates the azimuth of the rangefinder in calculation."}],"categories":["Arma 2: Functions","Arma 2: New Functions","Arma 2: Operation Arrowhead: Functions","Arma 3: Functions","Function Group: Geometry","Function Group: Positions","Functions","Introduced with Arma 2 version 1.00","Take On Helicopters: Functions"],"docblock":null,"filled_from_docblock":[]}