BIS fnc vectorAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|+$" to "")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *R([a-z ])" to "$1 - r$2")
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
|gr1= Vectors
|gr1= Vectors


|descr= Returns the sum of two vectors. {{Feature|arma3|If the vector is either 2D or 3D use [[vectorAdd]] instead.}}
|descr= Returns the sum of two vectors.
{{Feature|arma3|If the vector is either 2D or 3D use [[vectorAdd]] instead.}}


|s1= [vector1, vector2] call [[BIS_fnc_vectorAdd]]
|s1= [vector1, vector2] call [[BIS_fnc_vectorAdd]]


|p1= vector1: [[Array]] of [[Number|Numbers]]
|p1= vector1: [[Array]] of [[Number]]s


|p2= vector2: [[Array]] of [[Number|Numbers]]
|p2= vector2: [[Array]] of [[Number]]s


|r1= [[Array]] of [[Number|Numbers]] - Resulting vector
|r1= [[Array]] of [[Number]]s - resulting vector


|x1= <code><nowiki>[</nowiki>[1, 1, 1, 1, 1], [2, 5, 3, 1, 1]] [[call]] [[BIS_fnc_vectorAdd]]; {{cc|Returns [3,6,4,2,2]}}</code>
|x1= <sqf>[[1, 1, 1, 1, 1], [2, 5, 3, 1, 1]] call BIS_fnc_vectorAdd; // returns [3,6,4,2,2]</sqf>


|seealso= [[vectorAdd]]
|seealso= [[vectorAdd]]
}}
}}

Latest revision as of 16:47, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns the sum of two vectors.
Arma 3
If the vector is either 2D or 3D use vectorAdd instead.
Execution:
call
Groups:
Vectors

Syntax

Syntax:
[vector1, vector2] call BIS_fnc_vectorAdd
Parameters:
vector1: Array of Numbers
vector2: Array of Numbers
Return Value:
Array of Numbers - resulting vector

Examples

Example 1:
[[1, 1, 1, 1, 1], [2, 5, 3, 1, 1]] call BIS_fnc_vectorAdd; // returns [3,6,4,2,2]

Additional Information

See also:
vectorAdd

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