BIS fnc distance2Dsqr: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Some wiki formatting)
 
(41 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
/************************************************************
|version4= 0.50
Distance 2D Squared


Parameters: [object or position 1, object or position 2]
|gr1= Geometry


Returns the SQUARE of the distance between the two objects or
|descr= Returns the SQUARE of the distance between the two objects or positions "as the crow flies" (ignoring elevation).
positions "as the crow flies" (ignoring elevation).
Working in the squared domain is a little faster than using the
fn_distance2D function.


Example: [player, getpos dude] call  BIS_fnc_distance2Dsqr
{{Feature|arma3|This function became obsolete with the introduction of [[distanceSqr]].}}
************************************************************/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|s1= [pointA, pointB] call [[BIS_fnc_distance2Dsqr]]
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_distance2Dsqr]]; --> |= Syntax
|p1= pointA: [[Object]] or [[Position]]


|p1= |= Parameter 1
|p2= pointB: [[Object]] or [[Position]]


| |= Return value
|r1= [[Number]] - squared distance
____________________________________________________________________________________________


|x1= <code></code> |=
|x1= <sqf>[player, soldier_1] call BIS_fnc_distance2Dsqr;</sqf>
____________________________________________________________________________________________


| |= See also
|x2= <sqf>[[100,100,0], [0,0,0]] call BIS_fnc_distance2Dsqr;</sqf>


|seealso= [[BIS_fnc_distance2D]] [[distance2D]] [[distance]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Geometry|{{uc:distance2Dsqr}}]]
[[Category:Functions|{{uc:distance2Dsqr}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:distance2Dsqr}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:distance2Dsqr}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:distance2Dsqr}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:distance2Dsqr}}]]

Latest revision as of 10:53, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns the SQUARE of the distance between the two objects or positions "as the crow flies" (ignoring elevation).
Arma 3
This function became obsolete with the introduction of distanceSqr.
Execution:
call
Groups:
Geometry

Syntax

Syntax:
[pointA, pointB] call BIS_fnc_distance2Dsqr
Parameters:
pointA: Object or Position
pointB: Object or Position
Return Value:
Number - squared distance

Examples

Example 1:
[player, soldier_1] call BIS_fnc_distance2Dsqr;
Example 2:
[[100,100,0], [0,0,0]] call BIS_fnc_distance2Dsqr;

Additional Information

See also:
BIS_fnc_distance2D distance2D distance

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