BIS fnc distance2D: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(populated the page)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| Arma 2 version of [[distance2D]].<br />
Use [[distance2D]] instead if available as Arma 3's BIS_fnc_distance2D uses [[distance2D]] internally anyway<br />
<pre>
/************************************************************
/************************************************************
Distance 2D
Distance 2D
Line 23: Line 25:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_distance2D]]; --> |= Syntax
| [param1, param2] call '''BIS_fnc_distance2D''' |= Syntax


|p1= |= Parameter 1
|p1= param1: [[Object]] or [[Array]] in format [[Position]] or [[Position2D]]|= Parameter 1
|p2= param2: [[Object]] or [[Array]] in format [[Position]] or [[Position2D]]|= Parameter 2


| |= Return value
| [[Number]] -  Distance in meters or 1e10 if distance cannot be calculated |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code> [player, rescueHelicopter] call BIS_fnc_distance2D </code> |=  
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[distance2D]] |= See also


}}
}}

Revision as of 15:45, 19 November 2017


Hover & click on the images for description

Description

Description:
Arma 2 version of distance2D.
Use distance2D instead if available as Arma 3's BIS_fnc_distance2D uses distance2D internally anyway
/************************************************************
	Distance 2D

Parameters: [object or position 1, object or position 2]

Returns the distance between the two objects or positions
"as the crow flies" (ignoring elevation)
Example: [player, getpos dude] call BIS_fnc_distance2D
************************************************************/

//return squared distance between _pos1 and _pos2
(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[param1, param2] call BIS_fnc_distance2D
Parameters:
param1: Object or Array in format Position or Position2D
param2: Object or Array in format Position or Position2D
Return Value:
Number - Distance in meters or 1e10 if distance cannot be calculated

Examples

Example 1:
[player, rescueHelicopter] call BIS_fnc_distance2D

Additional Information

See also:
distance2D

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section