getGraphValues: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(WIP - someone who has knowledge of this please write more information)
 
m (Some wiki formatting)
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game=
|game1= arma3
|version1= 1.92


|1.92|Game Version =(number surrounded by NO SPACES)
|gr1= Math


|arg= |Multiplayer Arguments =("local" or "global")
|descr= Generate graph y - coordinates of all input values within specific x and y range.


|eff= |Multiplayer Effects =("local" or "global")
|s1= [[getGraphValues]] <nowiki>[[graphMinX, graphMaxX, graphMinY, graphMaxY, valueCount, randomOffset], x1, y1, x2, y2, ... xn, yn]</nowiki>


|exec= |Multiplayer Execution =("server" or empty)
|p1= graphMinX: [[Number]] - minimum x-axis value
____________________________________________________________________________________________


| Generate graph y - coordinates of all input values within specific x and y range {{wip}} |Description=
|p2= graphMaxX: [[Number]] - maximum x-axis value
____________________________________________________________________________________________


| [[getGraphValues]] <nowiki>[[graphMinX, graphMaxX, graphMinY, graphMaxY, valueCount, randomOffset], x1, y1, x2, y2, ... xn, yn]</nowiki> |Syntax=
|p3= graphMinY: [[Number]] - minimum y-axis value


|p1=<nowiki>[[graphMinX, graphMaxX, graphMinY, graphMaxY, valueCount, randomOffset], x1, y1, x2, y2, ... xn, yn]</nowiki>: [[Array]]
|p4= graphMaxY: [[Number]] - maximum y-axis value


|p2=graphMinX:  
|p5= valueCount: [[Number]] - number of values the returned array should have


|p3=graphMinY:  
|p7=randomOffset: [[Number]] - random range for returned y value


|p4=graphMaxX:  
|p8=x1..n: [[Number]] - n<sup>th</sup> x value


|p5=graphMaxY:  
|p9=y1..n: [[Number]] - n<sup>th</sup> y value


|p6=valueCount:
|r1= [[Array]] of [[Array]] of [[Number]]s - to format [arrayOfYvalues, arrayOfXvalues]


|p7=randomOffset:
|x1= <sqf>
private _minX = 0;
private _maxX = 10;
private _minY = 0;
private _maxY = 100;
private _count = 11;
private _random = 0;


|p8=x1:
getGraphValues [
[_minX, _maxX, _minY, _maxY, _count, _random],
0, 5,
1, 10,
2, 100,
3, 50,
4, 30,
5, 100,
6, 10,
7, 50,
8, 75,
9, 100,
10, 100
];
/*
returns [[0.05, 0.1, 1, 0.5, 0.3, 1, 0.1, 0.5, 0.75, 1, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
supposedly [array of 1-based Y values, array of X values]
*/
</sqf>


|p9=x2:
|seealso= [[decayGraphValues]]
 
| [[Array]] |Return Value=
____________________________________________________________________________________________
 
|x1= <code></code> |Example 1=
____________________________________________________________________________________________
 
|mp= - |Multiplayer Behaviour=
 
|  |See Also=
}}
}}
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- For example:
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
<dt class="note">'''[[User:User Name|User Name]]'''</dt>
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
-->
<!-- END Note Section -->
</dl>
<h3 style="display:none">Bottom Section</h3>
<!-- Appropriate categories go here -->
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 20:09, 3 May 2022

Hover & click on the images for description

Description

Description:
Generate graph y - coordinates of all input values within specific x and y range.
Groups:
Math

Syntax

Syntax:
getGraphValues [[graphMinX, graphMaxX, graphMinY, graphMaxY, valueCount, randomOffset], x1, y1, x2, y2, ... xn, yn]
Parameters:
graphMinX: Number - minimum x-axis value
graphMaxX: Number - maximum x-axis value
graphMinY: Number - minimum y-axis value
graphMaxY: Number - maximum y-axis value
valueCount: Number - number of values the returned array should have
randomOffset: Number - random range for returned y value
x1..n: Number - nth x value
y1..n: Number - nth y value
Return Value:
Array of Array of Numbers - to format [arrayOfYvalues, arrayOfXvalues]

Examples

Example 1:
private _minX = 0; private _maxX = 10; private _minY = 0; private _maxY = 100; private _count = 11; private _random = 0; getGraphValues [ [_minX, _maxX, _minY, _maxY, _count, _random], 0, 5, 1, 10, 2, 100, 3, 50, 4, 30, 5, 100, 6, 10, 7, 50, 8, 75, 9, 100, 10, 100 ]; /* returns [[0.05, 0.1, 1, 0.5, 0.3, 1, 0.1, 0.5, 0.75, 1, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]] supposedly [array of 1-based Y values, array of X values] */

Additional Information

See also:
decayGraphValues

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