getGraphValues: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
mNo edit summary
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


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


|1.92|Game Version =
|gr1= Math


|arg=  |Multiplayer Arguments =
|descr= Generate graph y - coordinates of all input values within specific x and y range.


|eff= |Multiplayer Effects =
|s1= [[getGraphValues]] <nowiki>[[graphMinX, graphMaxX, graphMinY, graphMaxY, valueCount, randomOffset], x1, y1, x2, y2, ...]</nowiki>
 
|serverExec=  |Multiplayer Execution ("server" or empty)=
 
|gr1 = Math |GROUP1=
 
| Generate graph y - coordinates of all input values within specific x and y range. |Description=
 
| [[getGraphValues]] <nowiki>[[graphMinX, graphMaxX, graphMinY, graphMaxY, valueCount, randomOffset], x1, y1, x2, y2, ... xn, yn]</nowiki> |Syntax=


|p1= graphMinX: [[Number]] - minimum x-axis value
|p1= graphMinX: [[Number]] - minimum x-axis value
Line 29: Line 22:
|p7=randomOffset: [[Number]] - random range for returned y value
|p7=randomOffset: [[Number]] - random range for returned y value


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


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


| [[Array]] of [[Array]] of [[Number]]s - to format [arrayOfYvalues, arrayOfXvalues] |Return Value=
|r1= [[Array]] of [[Array]] of [[Number]]s - to format [arrayOfYvalues, arrayOfXvalues]


|x1= <code>[[private]] _minX = 0;
|x1= <sqf>
[[private]] _maxX = 10;
private _minX = 0;
[[private]] _minY = 0;
private _maxX = 10;
[[private]] _maxY = 100;
private _minY = 0;
[[private]] _count = 11;
private _maxY = 100;
[[private]] _random = 0;
private _count = 11;
private _random = 0;


[[getGraphValues]] [
getGraphValues [
[_minX, _maxX, _minY, _maxY, _count, _random],
[_minX, _maxX, _minY, _maxY, _count, _random],
0, 5,
0, 5,
Line 56: Line 50:
10, 100
10, 100
];
];
{{codecomment|/*
/*
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]]
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]
supposedly [array of 1-based Y values, array of X values]
<nowiki>*</nowiki>/}}</code> |Example 1=
*/
</sqf>


| [[decayGraphValues]] |See Also=
|seealso= [[decayGraphValues]]
}}
}}
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- END Note Section -->
</dl>
<h3 style="display:none">Bottom Section</h3>
<!-- Appropriate categories go here -->
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 06:02, 27 November 2023

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, ...]
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
xN: Number - nth x value
yN: 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