BIS fnc vectorDivide: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Page filling) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=function | ||
| arma3 | | |game1= arma3 | ||
|version1= 1.00 | |||
| | |gr1= Vectors | ||
| Divides vector by scalar, by dividing all vector elements. | |descr= Divides vector by scalar, by dividing all vector elements. | ||
{{ | {{Feature|informative| | ||
[[vectorMultiply]] can be used instead as <sqf inline>vector vectorMultiply 1/scale</sqf>, but: | |||
* ''scale'' cannot be 0 | * ''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.}} | * 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. | ||
}} | |||
| [vector, divider] call [[BIS_fnc_vectorDivide]] | |s1= [vector, divider] call [[BIS_fnc_vectorDivide]] | ||
|p1= vector: [[Array]] of [[Number]]s - (Optional, default [0,0,0]) can be any array of numbers | |p1= vector: [[Array]] of [[Number]]s - (Optional, default [0,0,0]) can be any array of numbers | ||
|p2= divider: [[Number]] - (Optional, default 1) | |p2= divider: [[Number]] - (Optional, default 1) | ||
| [[Array]] of [[Number]]s | |r1= [[Array]] of [[Number]]s | ||
|x1= < | |x1= <sqf>[[123, 456, 789], 5] call BIS_fnc_vectorDivide;</sqf> | ||
|x2= < | |x2= <sqf>[[1, 2, 3, 4, 5, 6, 7, 8, 9], 5] call BIS_fnc_vectorDivide;</sqf> | ||
| [[vectorMultiply]] [[BIS_fnc_vectorMultiply]] | |seealso= [[vectorMultiply]] [[BIS_fnc_vectorMultiply]] | ||
}} | }} | ||
Latest revision as of 14:35, 13 July 2022
Description
- Description:
- Divides vector by scalar, by dividing all vector elements.
- Execution:
- call
- Groups:
- Vectors
Syntax
- Syntax:
- [vector, divider] call BIS_fnc_vectorDivide
- Parameters:
- vector: Array of Numbers - (Optional, default [0,0,0]) can be any array of numbers
- divider: Number - (Optional, default 1)
- Return Value:
- Array of Numbers
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- vectorMultiply BIS_fnc_vectorMultiply
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