BIS fnc vectorDivide: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (infobox to template)
(Page filling)
Line 1: Line 1:
{{Function|= Comments
{{Function|Comments=


| arma3 |Game name=
| arma3 |Game name=
Line 5: Line 5:
|1.00|Game version=
|1.00|Game version=


<!---|arg= local |Multiplayer Arguments=--->
| Divides vector by scalar, by dividing all vector elements.
{{Informative | [[vectorMultiply]] can be used instead as {{Inline code|vector [[vectorMultiply]] 1/scale}}, but:
* ''scale'' cannot be 0
* in some rare cases, the result is not ''exactly'' the same as [[BIS_fnc_vectorDivide]] - this is due to [[Floating Point Number]] precision and rounding.}} |Description=


<!---|eff= local |Multiplayer Effects=--->
| [vector, divider] call [[BIS_fnc_vectorDivide]] |Syntax=


| <pre>/*
|p1= vector: [[Array]] of [[Number]]s - (Optional, default [0,0,0]) can be any array of numbers. |Parameter 1=
Author:
Nelson Duarte


Description:
|p2= divider: [[Number]] - (Optional, default 1)
Divides vector by scalar, by dividing all vector elements


Parameters:
| [[Array]] of [[Number]]s |Return value=
_this: ARRAY
0: ARRAY - The vector to divide
1: ARRAY - The scale used to divide each vector element


Returns:
|x1= <code>[[123, 456, 789], 5] [[call]] [[BIS_fnc_vectorDivide]];</code> |Example 1=
ARRAY
*/</pre>{{placeholder}}<!-- Remove this after fill-in --> |Description=


|[] call [[BIS_fnc_vectorDivide]]|Syntax=
|x2= <code>[[1, 2, 3, 4, 5, 6, 7, 8, 9], 5] [[call]] [[BIS_fnc_vectorDivide]];</code> |Example 2=


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
| [[vectorMultiply]] [[BIS_fnc_vectorMultiply]] |See also=
 
|Datatype - description|Return value=
 
|x1= <code></code>|Example 1=
 
| |See also=
}}
}}


[[Category:Function Group: Math|{{uc:vectorDivide}}]]
[[Category:Function Group: Math|{{uc:vectorDivide}}]]
[[Category:Functions|{{uc:vectorDivide}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:vectorDivide}}]]

Revision as of 22:58, 26 June 2020

{{Function|Comments=

| arma3 |Game name=

|1.00|Game version=

| Divides vector by scalar, by dividing all vector elements.

vectorMultiply can be used instead as vector vectorMultiply 1/scale, but:

|Description=

| [vector, divider] call BIS_fnc_vectorDivide |Syntax=

|p1= vector: Array of Numbers - (Optional, default [0,0,0]) can be any array of numbers. |Parameter 1=

|p2= divider: Number - (Optional, default 1)

| Array of Numbers |Return value=

|x1= [[123, 456, 789], 5] call BIS_fnc_vectorDivide; |Example 1=

|x2= [[1, 2, 3, 4, 5, 6, 7, 8, 9], 5] call BIS_fnc_vectorDivide; |Example 2=

| vectorMultiply BIS_fnc_vectorMultiply |See also= }}