distanceSqr

From Bohemia Interactive Community
Revision as of 00:02, 11 June 2021 by Lou Montana (talk | contribs) (Text replacement - " +" to " ")
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Description needed
Groups:
Math - Geometry

Syntax

Syntax:
Syntax needed
Parameters:
var1: Object or Position
var2: Object or Position
Return Value:
Number Distance in meters or 1e10 if distance cannot be calculated

Examples

Example 1:
player distanceSqr (leader player)
Example 2:
_distance = sqrt ((x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2); _distanceSqr = (x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2; _distance = [x1, y1, z1] distance [x2, y2, z2]; _distanceSqr = [x1, y1, z1] distanceSqr [x2, y2, z2]; _distance = sqrt ([x1, y1, z1] distanceSqr [x2, y2, z2]); _distanceSqr = ([x1, y1, z1] distance [x2, y2, z2]) ^ 2; If normal distance is calculated according to this formula: squared distance is calculated according to this formula: distanceSqr =

Additional Information

See also:
distancevectorDistanceSqrdistance2D

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