distanceSqr: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}") |
Lou Montana (talk | contribs) m (Text replacement - "\[https?\:\/\/en\.wikipedia\.org\/wiki\/([^ ]+) (.+)\]" to "{{Wikipedia|$1|$2}}") |
||
Line 7: | Line 7: | ||
|gr1= Math - Geometry | |gr1= Math - Geometry | ||
| Computes the | | Computes the {{Wikipedia|Euclidean_distance#Squared_Euclidean_distance|squared distance}} between two objects or positions. | ||
| var1 '''distanceSqr''' var2 | | var1 '''distanceSqr''' var2 |
Revision as of 15:56, 30 May 2021
Description
- Description:
- Description needed
- Groups:
- Math - Geometry
Syntax
- Syntax:
- Syntax needed
- Parameters:
- var1: Object or Position
- var2: Object or Position
- Return Value:
- Return value needed
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